You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-11-03 17:13:17 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			37 lines
		
	
	
		
			892 B
		
	
	
	
		
			ReStructuredText
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			892 B
		
	
	
	
		
			ReStructuredText
		
	
	
	
	
	
.. _udafmap:
 | 
						|
 | 
						|
UDAFMap
 | 
						|
=======
 | 
						|
 | 
						|
The UDAFMap is where we tell the system about our function. For Columnstore 1.2, you must manually place your function into this map.
 | 
						|
 | 
						|
* open mcsv1_udaf.cpp
 | 
						|
* add your header to the #include list
 | 
						|
* add a new line to the UDAFMap::getMap() function
 | 
						|
 | 
						|
::
 | 
						|
 | 
						|
 #include "allnull.h"
 | 
						|
 #include "ssq.h"
 | 
						|
 #include "median.h"
 | 
						|
 #include "avg_mode.h"
 | 
						|
 UDAF_MAP& UDAFMap::getMap()
 | 
						|
 {
 | 
						|
    if (fm.size() > 0)
 | 
						|
    {
 | 
						|
        return fm;
 | 
						|
	}
 | 
						|
    // first: function name
 | 
						|
    // second: Function pointer
 | 
						|
    // please use lower case for the function name. Because the names might be 
 | 
						|
    // case-insensitive in MySQL depending on the setting. In such case, 
 | 
						|
    // the function names passed to the interface is always in lower case.
 | 
						|
    fm["allnull"] = new allnull();
 | 
						|
    fm["ssq"] = new ssq();
 | 
						|
    fm["median"] = new median();
 | 
						|
    fm["avg_mode"] = new avg_mode();
 | 
						|
	
 | 
						|
    return fm;
 | 
						|
 }
 | 
						|
 |