You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-1385 Fix window functions
MariaDB maps MEDIAN to PERCENTILE_CONT and also has PERCENTILE_DISC now. So remove our MEDIAN UDAF but keep the source as it is used in docs.
This commit is contained in:
@ -289,6 +289,13 @@ string ConvertFuncName(Item_sum* item)
|
|||||||
return "PERCENT_RANK";
|
return "PERCENT_RANK";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Item_sum::PERCENTILE_CONT_FUNC:
|
||||||
|
return "PERCENTILE_CONT";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Item_sum::PERCENTILE_DISC_FUNC:
|
||||||
|
return "PERCENTILE_DISC";
|
||||||
|
|
||||||
case Item_sum::CUME_DIST_FUNC:
|
case Item_sum::CUME_DIST_FUNC:
|
||||||
return "CUME_DIST";
|
return "CUME_DIST";
|
||||||
break;
|
break;
|
||||||
|
@ -4,7 +4,7 @@ include_directories( ${ENGINE_COMMON_INCLUDES}
|
|||||||
|
|
||||||
########### next target ###############
|
########### next target ###############
|
||||||
|
|
||||||
set(udfsdk_LIB_SRCS udfsdk.cpp mcsv1_udaf.cpp allnull.cpp ssq.cpp median.cpp avg_mode.cpp regr_avgx.cpp avgx.cpp)
|
set(udfsdk_LIB_SRCS udfsdk.cpp mcsv1_udaf.cpp allnull.cpp ssq.cpp avg_mode.cpp regr_avgx.cpp avgx.cpp)
|
||||||
|
|
||||||
add_definitions(-DMYSQL_DYNAMIC_PLUGIN)
|
add_definitions(-DMYSQL_DYNAMIC_PLUGIN)
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ using namespace mcsv1sdk;
|
|||||||
UDAF_MAP UDAFMap::fm;
|
UDAF_MAP UDAFMap::fm;
|
||||||
#include "allnull.h"
|
#include "allnull.h"
|
||||||
#include "ssq.h"
|
#include "ssq.h"
|
||||||
#include "median.h"
|
|
||||||
#include "avg_mode.h"
|
#include "avg_mode.h"
|
||||||
#include "regr_avgx.h"
|
#include "regr_avgx.h"
|
||||||
#include "avgx.h"
|
#include "avgx.h"
|
||||||
@ -52,7 +51,6 @@ UDAF_MAP& UDAFMap::getMap()
|
|||||||
// the function names passed to the interface is always in lower case.
|
// the function names passed to the interface is always in lower case.
|
||||||
fm["allnull"] = new allnull();
|
fm["allnull"] = new allnull();
|
||||||
fm["ssq"] = new ssq();
|
fm["ssq"] = new ssq();
|
||||||
fm["median"] = new median();
|
|
||||||
fm["avg_mode"] = new avg_mode();
|
fm["avg_mode"] = new avg_mode();
|
||||||
fm["regr_avgx"] = new regr_avgx();
|
fm["regr_avgx"] = new regr_avgx();
|
||||||
fm["avgx"] = new avgx();
|
fm["avgx"] = new avgx();
|
||||||
|
@ -349,78 +349,6 @@ extern "C"
|
|||||||
return data->sumsq;
|
return data->sumsq;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MEDIAN connector stub
|
|
||||||
*/
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
__declspec(dllexport)
|
|
||||||
#endif
|
|
||||||
my_bool median_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
|
|
||||||
{
|
|
||||||
if (args->arg_count != 1)
|
|
||||||
{
|
|
||||||
strcpy(message, "median() requires one argument");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (!(data = (struct ssq_data*) malloc(sizeof(struct ssq_data))))
|
|
||||||
{
|
|
||||||
strmov(message,"Couldn't allocate memory");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
data->sumsq = 0;
|
|
||||||
|
|
||||||
initid->ptr = (char*)data;
|
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
__declspec(dllexport)
|
|
||||||
#endif
|
|
||||||
void median_deinit(UDF_INIT* initid)
|
|
||||||
{
|
|
||||||
// free(initid->ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
__declspec(dllexport)
|
|
||||||
#endif
|
|
||||||
void
|
|
||||||
median_clear(UDF_INIT* initid, char* is_null __attribute__((unused)),
|
|
||||||
char* message __attribute__((unused)))
|
|
||||||
{
|
|
||||||
// struct ssq_data* data = (struct ssq_data*)initid->ptr;
|
|
||||||
// data->sumsq = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
__declspec(dllexport)
|
|
||||||
#endif
|
|
||||||
void
|
|
||||||
median_add(UDF_INIT* initid, UDF_ARGS* args,
|
|
||||||
char* is_null,
|
|
||||||
char* message __attribute__((unused)))
|
|
||||||
{
|
|
||||||
// struct ssq_data* data = (struct ssq_data*)initid->ptr;
|
|
||||||
// double val = cvtArgToDouble(args->arg_type[0], args->args[0]);
|
|
||||||
// data->sumsq = val*val;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
__declspec(dllexport)
|
|
||||||
#endif
|
|
||||||
long long median(UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)),
|
|
||||||
char* is_null, char* error __attribute__((unused)))
|
|
||||||
{
|
|
||||||
// struct ssq_data* data = (struct ssq_data*)initid->ptr;
|
|
||||||
// return data->sumsq;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* avg_mode connector stub
|
* avg_mode connector stub
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user