enh: format code
This commit is contained in:
parent
eccdc9b6ca
commit
cc231653ad
|
@ -143,9 +143,7 @@ static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, in
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t translateTimezone(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
static int32_t translateTimezone(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
||||||
SExprNode* pPara1 = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 0);
|
pFunc->node.resType = (SDataType){.bytes = TD_TIMEZONE_LEN, .type = TSDB_DATA_TYPE_BINARY};
|
||||||
pFunc->node.resType = (SDataType){.bytes = pPara1->resType.bytes, .type = pPara1->resType.type};
|
|
||||||
//pFunc->node.resType = (SDataType){.bytes = TD_TIMEZONE_LEN, .type = TSDB_DATA_TYPE_BINARY};
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +166,8 @@ static bool validAperventileAlgo(const SValueNode* pVal) {
|
||||||
if (TSDB_DATA_TYPE_BINARY != pVal->node.resType.type) {
|
if (TSDB_DATA_TYPE_BINARY != pVal->node.resType.type) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return (0 == strcasecmp(varDataVal(pVal->datum.p), "default") || 0 == strcasecmp(varDataVal(pVal->datum.p), "t-digest"));
|
return (0 == strcasecmp(varDataVal(pVal->datum.p), "default") ||
|
||||||
|
0 == strcasecmp(varDataVal(pVal->datum.p), "t-digest"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t translateApercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
static int32_t translateApercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
||||||
|
@ -185,7 +184,8 @@ static int32_t translateApercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t
|
||||||
if (3 == paraNum) {
|
if (3 == paraNum) {
|
||||||
SNode* pPara3 = nodesListGetNode(pFunc->pParameterList, 2);
|
SNode* pPara3 = nodesListGetNode(pFunc->pParameterList, 2);
|
||||||
if (QUERY_NODE_VALUE != nodeType(pPara3) || !validAperventileAlgo((SValueNode*)pPara3)) {
|
if (QUERY_NODE_VALUE != nodeType(pPara3) || !validAperventileAlgo((SValueNode*)pPara3)) {
|
||||||
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, "Third parameter algorithm of apercentile must be 'default' or 't-digest'");
|
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR,
|
||||||
|
"Third parameter algorithm of apercentile must be 'default' or 't-digest'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,8 @@ static int32_t translateApercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t
|
||||||
|
|
||||||
static int32_t translateTbnameColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
static int32_t translateTbnameColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
||||||
// pseudo column do not need to check parameters
|
// pseudo column do not need to check parameters
|
||||||
pFunc->node.resType = (SDataType){.bytes = TSDB_TABLE_FNAME_LEN - 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR};
|
pFunc->node.resType =
|
||||||
|
(SDataType){.bytes = TSDB_TABLE_FNAME_LEN - 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR};
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +229,8 @@ static int32_t translateFirstLast(SFunctionNode* pFunc, char* pErrBuf, int32_t l
|
||||||
|
|
||||||
SNode* pPara = nodesListGetNode(pFunc->pParameterList, 0);
|
SNode* pPara = nodesListGetNode(pFunc->pParameterList, 0);
|
||||||
if (QUERY_NODE_COLUMN != nodeType(pPara)) {
|
if (QUERY_NODE_COLUMN != nodeType(pPara)) {
|
||||||
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, "The parameters of first/last can only be columns");
|
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR,
|
||||||
|
"The parameters of first/last can only be columns");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t paraType = ((SExprNode*)pPara)->resType.type;
|
uint8_t paraType = ((SExprNode*)pPara)->resType.type;
|
||||||
|
@ -245,11 +247,13 @@ static int32_t translateLength(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
|
||||||
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[TSDB_DATA_TYPE_SMALLINT].bytes, .type = TSDB_DATA_TYPE_SMALLINT };
|
pFunc->node.resType =
|
||||||
|
(SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_SMALLINT].bytes, .type = TSDB_DATA_TYPE_SMALLINT};
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t translateConcatImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t len, int32_t minParaNum, int32_t maxParaNum, bool hasSep) {
|
static int32_t translateConcatImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t len, int32_t minParaNum,
|
||||||
|
int32_t maxParaNum, bool hasSep) {
|
||||||
int32_t paraNum = LIST_LENGTH(pFunc->pParameterList);
|
int32_t paraNum = LIST_LENGTH(pFunc->pParameterList);
|
||||||
if (paraNum < minParaNum || paraNum > maxParaNum) {
|
if (paraNum < minParaNum || paraNum > maxParaNum) {
|
||||||
return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName);
|
return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName);
|
||||||
|
@ -379,11 +383,13 @@ static int32_t translateTimeTruncate(SFunctionNode* pFunc, char* pErrBuf, int32_
|
||||||
|
|
||||||
uint8_t para1Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type;
|
uint8_t para1Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type;
|
||||||
uint8_t para2Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 1))->resType.type;
|
uint8_t para2Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 1))->resType.type;
|
||||||
if ((!IS_VAR_DATA_TYPE(para1Type) && !IS_INTEGER_TYPE(para1Type) && TSDB_DATA_TYPE_TIMESTAMP != para1Type) || !IS_INTEGER_TYPE(para2Type)) {
|
if ((!IS_VAR_DATA_TYPE(para1Type) && !IS_INTEGER_TYPE(para1Type) && TSDB_DATA_TYPE_TIMESTAMP != para1Type) ||
|
||||||
|
!IS_INTEGER_TYPE(para2Type)) {
|
||||||
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes, .type = TSDB_DATA_TYPE_TIMESTAMP};
|
pFunc->node.resType =
|
||||||
|
(SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes, .type = TSDB_DATA_TYPE_TIMESTAMP};
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,8 +431,7 @@ static int32_t translateToJson(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
{
|
{.name = "count",
|
||||||
.name = "count",
|
|
||||||
.type = FUNCTION_TYPE_COUNT,
|
.type = FUNCTION_TYPE_COUNT,
|
||||||
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
|
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
|
||||||
.translateFunc = translateCount,
|
.translateFunc = translateCount,
|
||||||
|
@ -434,10 +439,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
.getEnvFunc = getCountFuncEnv,
|
.getEnvFunc = getCountFuncEnv,
|
||||||
.initFunc = functionSetup,
|
.initFunc = functionSetup,
|
||||||
.processFunc = countFunction,
|
.processFunc = countFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "sum",
|
||||||
{
|
|
||||||
.name = "sum",
|
|
||||||
.type = FUNCTION_TYPE_SUM,
|
.type = FUNCTION_TYPE_SUM,
|
||||||
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
|
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
|
||||||
.translateFunc = translateSum,
|
.translateFunc = translateSum,
|
||||||
|
@ -445,10 +448,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
.getEnvFunc = getSumFuncEnv,
|
.getEnvFunc = getSumFuncEnv,
|
||||||
.initFunc = functionSetup,
|
.initFunc = functionSetup,
|
||||||
.processFunc = sumFunction,
|
.processFunc = sumFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "min",
|
||||||
{
|
|
||||||
.name = "min",
|
|
||||||
.type = FUNCTION_TYPE_MIN,
|
.type = FUNCTION_TYPE_MIN,
|
||||||
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
|
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
|
||||||
.translateFunc = translateInOutNum,
|
.translateFunc = translateInOutNum,
|
||||||
|
@ -456,10 +457,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
.getEnvFunc = getMinmaxFuncEnv,
|
.getEnvFunc = getMinmaxFuncEnv,
|
||||||
.initFunc = minFunctionSetup,
|
.initFunc = minFunctionSetup,
|
||||||
.processFunc = minFunction,
|
.processFunc = minFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "max",
|
||||||
{
|
|
||||||
.name = "max",
|
|
||||||
.type = FUNCTION_TYPE_MAX,
|
.type = FUNCTION_TYPE_MAX,
|
||||||
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
|
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
|
||||||
.translateFunc = translateInOutNum,
|
.translateFunc = translateInOutNum,
|
||||||
|
@ -467,48 +466,39 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
.getEnvFunc = getMinmaxFuncEnv,
|
.getEnvFunc = getMinmaxFuncEnv,
|
||||||
.initFunc = maxFunctionSetup,
|
.initFunc = maxFunctionSetup,
|
||||||
.processFunc = maxFunction,
|
.processFunc = maxFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "stddev",
|
||||||
{
|
|
||||||
.name = "stddev",
|
|
||||||
.type = FUNCTION_TYPE_STDDEV,
|
.type = FUNCTION_TYPE_STDDEV,
|
||||||
.classification = FUNC_MGT_AGG_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = getStddevFuncEnv,
|
.getEnvFunc = getStddevFuncEnv,
|
||||||
.initFunc = stddevFunctionSetup,
|
.initFunc = stddevFunctionSetup,
|
||||||
.processFunc = stddevFunction,
|
.processFunc = stddevFunction,
|
||||||
.finalizeFunc = stddevFinalize
|
.finalizeFunc = stddevFinalize},
|
||||||
},
|
{.name = "avg",
|
||||||
{
|
|
||||||
.name = "avg",
|
|
||||||
.type = FUNCTION_TYPE_AVG,
|
.type = FUNCTION_TYPE_AVG,
|
||||||
.classification = FUNC_MGT_AGG_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = getAvgFuncEnv,
|
.getEnvFunc = getAvgFuncEnv,
|
||||||
.initFunc = avgFunctionSetup,
|
.initFunc = avgFunctionSetup,
|
||||||
.processFunc = avgFunction,
|
.processFunc = avgFunction,
|
||||||
.finalizeFunc = avgFinalize
|
.finalizeFunc = avgFinalize},
|
||||||
},
|
{.name = "percentile",
|
||||||
{
|
|
||||||
.name = "percentile",
|
|
||||||
.type = FUNCTION_TYPE_PERCENTILE,
|
.type = FUNCTION_TYPE_PERCENTILE,
|
||||||
.classification = FUNC_MGT_AGG_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC,
|
||||||
.translateFunc = translatePercentile,
|
.translateFunc = translatePercentile,
|
||||||
.getEnvFunc = getPercentileFuncEnv,
|
.getEnvFunc = getPercentileFuncEnv,
|
||||||
.initFunc = percentileFunctionSetup,
|
.initFunc = percentileFunctionSetup,
|
||||||
.processFunc = percentileFunction,
|
.processFunc = percentileFunction,
|
||||||
.finalizeFunc = percentileFinalize
|
.finalizeFunc = percentileFinalize},
|
||||||
},
|
{.name = "apercentile",
|
||||||
{
|
|
||||||
.name = "apercentile",
|
|
||||||
.type = FUNCTION_TYPE_APERCENTILE,
|
.type = FUNCTION_TYPE_APERCENTILE,
|
||||||
.classification = FUNC_MGT_AGG_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC,
|
||||||
.translateFunc = translateApercentile,
|
.translateFunc = translateApercentile,
|
||||||
.getEnvFunc = getMinmaxFuncEnv,
|
.getEnvFunc = getMinmaxFuncEnv,
|
||||||
.initFunc = maxFunctionSetup,
|
.initFunc = maxFunctionSetup,
|
||||||
.processFunc = maxFunction,
|
.processFunc = maxFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.name = "top",
|
.name = "top",
|
||||||
.type = FUNCTION_TYPE_TOP,
|
.type = FUNCTION_TYPE_TOP,
|
||||||
|
@ -519,446 +509,357 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
.processFunc = topFunction,
|
.processFunc = topFunction,
|
||||||
.finalizeFunc = topBotFinalize,
|
.finalizeFunc = topBotFinalize,
|
||||||
},
|
},
|
||||||
{
|
{.name = "bottom",
|
||||||
.name = "bottom",
|
|
||||||
.type = FUNCTION_TYPE_BOTTOM,
|
.type = FUNCTION_TYPE_BOTTOM,
|
||||||
.classification = FUNC_MGT_AGG_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC,
|
||||||
.translateFunc = translateBottom,
|
.translateFunc = translateBottom,
|
||||||
.getEnvFunc = getMinmaxFuncEnv,
|
.getEnvFunc = getMinmaxFuncEnv,
|
||||||
.initFunc = maxFunctionSetup,
|
.initFunc = maxFunctionSetup,
|
||||||
.processFunc = maxFunction,
|
.processFunc = maxFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "spread",
|
||||||
{
|
|
||||||
.name = "spread",
|
|
||||||
.type = FUNCTION_TYPE_SPREAD,
|
.type = FUNCTION_TYPE_SPREAD,
|
||||||
.classification = FUNC_MGT_AGG_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC,
|
||||||
.translateFunc = translateSpread,
|
.translateFunc = translateSpread,
|
||||||
.getEnvFunc = getMinmaxFuncEnv,
|
.getEnvFunc = getMinmaxFuncEnv,
|
||||||
.initFunc = maxFunctionSetup,
|
.initFunc = maxFunctionSetup,
|
||||||
.processFunc = maxFunction,
|
.processFunc = maxFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "last_row",
|
||||||
{
|
|
||||||
.name = "last_row",
|
|
||||||
.type = FUNCTION_TYPE_LAST_ROW,
|
.type = FUNCTION_TYPE_LAST_ROW,
|
||||||
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
|
||||||
.translateFunc = translateLastRow,
|
.translateFunc = translateLastRow,
|
||||||
.getEnvFunc = getMinmaxFuncEnv,
|
.getEnvFunc = getMinmaxFuncEnv,
|
||||||
.initFunc = maxFunctionSetup,
|
.initFunc = maxFunctionSetup,
|
||||||
.processFunc = maxFunction,
|
.processFunc = maxFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "first",
|
||||||
{
|
|
||||||
.name = "first",
|
|
||||||
.type = FUNCTION_TYPE_FIRST,
|
.type = FUNCTION_TYPE_FIRST,
|
||||||
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
|
||||||
.translateFunc = translateFirstLast,
|
.translateFunc = translateFirstLast,
|
||||||
.getEnvFunc = getFirstLastFuncEnv,
|
.getEnvFunc = getFirstLastFuncEnv,
|
||||||
.initFunc = functionSetup,
|
.initFunc = functionSetup,
|
||||||
.processFunc = firstFunction,
|
.processFunc = firstFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "last",
|
||||||
{
|
|
||||||
.name = "last",
|
|
||||||
.type = FUNCTION_TYPE_LAST,
|
.type = FUNCTION_TYPE_LAST,
|
||||||
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
|
||||||
.translateFunc = translateFirstLast,
|
.translateFunc = translateFirstLast,
|
||||||
.getEnvFunc = getFirstLastFuncEnv,
|
.getEnvFunc = getFirstLastFuncEnv,
|
||||||
.initFunc = functionSetup,
|
.initFunc = functionSetup,
|
||||||
.processFunc = lastFunction,
|
.processFunc = lastFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "diff",
|
||||||
{
|
|
||||||
.name = "diff",
|
|
||||||
.type = FUNCTION_TYPE_DIFF,
|
.type = FUNCTION_TYPE_DIFF,
|
||||||
.classification = FUNC_MGT_NONSTANDARD_SQL_FUNC,
|
.classification = FUNC_MGT_NONSTANDARD_SQL_FUNC,
|
||||||
.translateFunc = translateInOutNum,
|
.translateFunc = translateInOutNum,
|
||||||
.getEnvFunc = getDiffFuncEnv,
|
.getEnvFunc = getDiffFuncEnv,
|
||||||
.initFunc = diffFunctionSetup,
|
.initFunc = diffFunctionSetup,
|
||||||
.processFunc = diffFunction,
|
.processFunc = diffFunction,
|
||||||
.finalizeFunc = functionFinalize
|
.finalizeFunc = functionFinalize},
|
||||||
},
|
{.name = "abs",
|
||||||
{
|
|
||||||
.name = "abs",
|
|
||||||
.type = FUNCTION_TYPE_ABS,
|
.type = FUNCTION_TYPE_ABS,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInOutNum,
|
.translateFunc = translateInOutNum,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = absFunction,
|
.sprocessFunc = absFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "log",
|
||||||
{
|
|
||||||
.name = "log",
|
|
||||||
.type = FUNCTION_TYPE_LOG,
|
.type = FUNCTION_TYPE_LOG,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateIn2NumOutDou,
|
.translateFunc = translateIn2NumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = logFunction,
|
.sprocessFunc = logFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "pow",
|
||||||
{
|
|
||||||
.name = "pow",
|
|
||||||
.type = FUNCTION_TYPE_POW,
|
.type = FUNCTION_TYPE_POW,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateIn2NumOutDou,
|
.translateFunc = translateIn2NumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = powFunction,
|
.sprocessFunc = powFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "sqrt",
|
||||||
{
|
|
||||||
.name = "sqrt",
|
|
||||||
.type = FUNCTION_TYPE_SQRT,
|
.type = FUNCTION_TYPE_SQRT,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = sqrtFunction,
|
.sprocessFunc = sqrtFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "ceil",
|
||||||
{
|
|
||||||
.name = "ceil",
|
|
||||||
.type = FUNCTION_TYPE_CEIL,
|
.type = FUNCTION_TYPE_CEIL,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInOutNum,
|
.translateFunc = translateInOutNum,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = ceilFunction,
|
.sprocessFunc = ceilFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "floor",
|
||||||
{
|
|
||||||
.name = "floor",
|
|
||||||
.type = FUNCTION_TYPE_FLOOR,
|
.type = FUNCTION_TYPE_FLOOR,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInOutNum,
|
.translateFunc = translateInOutNum,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = floorFunction,
|
.sprocessFunc = floorFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "round",
|
||||||
{
|
|
||||||
.name = "round",
|
|
||||||
.type = FUNCTION_TYPE_ROUND,
|
.type = FUNCTION_TYPE_ROUND,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInOutNum,
|
.translateFunc = translateInOutNum,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = roundFunction,
|
.sprocessFunc = roundFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "sin",
|
||||||
{
|
|
||||||
.name = "sin",
|
|
||||||
.type = FUNCTION_TYPE_SIN,
|
.type = FUNCTION_TYPE_SIN,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = sinFunction,
|
.sprocessFunc = sinFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "cos",
|
||||||
{
|
|
||||||
.name = "cos",
|
|
||||||
.type = FUNCTION_TYPE_COS,
|
.type = FUNCTION_TYPE_COS,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = cosFunction,
|
.sprocessFunc = cosFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "tan",
|
||||||
{
|
|
||||||
.name = "tan",
|
|
||||||
.type = FUNCTION_TYPE_TAN,
|
.type = FUNCTION_TYPE_TAN,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = tanFunction,
|
.sprocessFunc = tanFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "asin",
|
||||||
{
|
|
||||||
.name = "asin",
|
|
||||||
.type = FUNCTION_TYPE_ASIN,
|
.type = FUNCTION_TYPE_ASIN,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = asinFunction,
|
.sprocessFunc = asinFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "acos",
|
||||||
{
|
|
||||||
.name = "acos",
|
|
||||||
.type = FUNCTION_TYPE_ACOS,
|
.type = FUNCTION_TYPE_ACOS,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = acosFunction,
|
.sprocessFunc = acosFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "atan",
|
||||||
{
|
|
||||||
.name = "atan",
|
|
||||||
.type = FUNCTION_TYPE_ATAN,
|
.type = FUNCTION_TYPE_ATAN,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateInNumOutDou,
|
.translateFunc = translateInNumOutDou,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = atanFunction,
|
.sprocessFunc = atanFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "length",
|
||||||
{
|
|
||||||
.name = "length",
|
|
||||||
.type = FUNCTION_TYPE_LENGTH,
|
.type = FUNCTION_TYPE_LENGTH,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateLength,
|
.translateFunc = translateLength,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = lengthFunction,
|
.sprocessFunc = lengthFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "char_length",
|
||||||
{
|
|
||||||
.name = "char_length",
|
|
||||||
.type = FUNCTION_TYPE_CHAR_LENGTH,
|
.type = FUNCTION_TYPE_CHAR_LENGTH,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateLength,
|
.translateFunc = translateLength,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = charLengthFunction,
|
.sprocessFunc = charLengthFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "concat",
|
||||||
{
|
|
||||||
.name = "concat",
|
|
||||||
.type = FUNCTION_TYPE_CONCAT,
|
.type = FUNCTION_TYPE_CONCAT,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateConcat,
|
.translateFunc = translateConcat,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = concatFunction,
|
.sprocessFunc = concatFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "concat_ws",
|
||||||
{
|
|
||||||
.name = "concat_ws",
|
|
||||||
.type = FUNCTION_TYPE_CONCAT_WS,
|
.type = FUNCTION_TYPE_CONCAT_WS,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateConcatWs,
|
.translateFunc = translateConcatWs,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = concatWsFunction,
|
.sprocessFunc = concatWsFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "lower",
|
||||||
{
|
|
||||||
.name = "lower",
|
|
||||||
.type = FUNCTION_TYPE_LOWER,
|
.type = FUNCTION_TYPE_LOWER,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateInOutStr,
|
.translateFunc = translateInOutStr,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = lowerFunction,
|
.sprocessFunc = lowerFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "upper",
|
||||||
{
|
|
||||||
.name = "upper",
|
|
||||||
.type = FUNCTION_TYPE_UPPER,
|
.type = FUNCTION_TYPE_UPPER,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateInOutStr,
|
.translateFunc = translateInOutStr,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = upperFunction,
|
.sprocessFunc = upperFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "ltrim",
|
||||||
{
|
|
||||||
.name = "ltrim",
|
|
||||||
.type = FUNCTION_TYPE_LTRIM,
|
.type = FUNCTION_TYPE_LTRIM,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateInOutStr,
|
.translateFunc = translateInOutStr,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = ltrimFunction,
|
.sprocessFunc = ltrimFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "rtrim",
|
||||||
{
|
|
||||||
.name = "rtrim",
|
|
||||||
.type = FUNCTION_TYPE_RTRIM,
|
.type = FUNCTION_TYPE_RTRIM,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateInOutStr,
|
.translateFunc = translateInOutStr,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = rtrimFunction,
|
.sprocessFunc = rtrimFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "substr",
|
||||||
{
|
|
||||||
.name = "substr",
|
|
||||||
.type = FUNCTION_TYPE_SUBSTR,
|
.type = FUNCTION_TYPE_SUBSTR,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
|
||||||
.translateFunc = translateSubstr,
|
.translateFunc = translateSubstr,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = substrFunction,
|
.sprocessFunc = substrFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "cast",
|
||||||
{
|
|
||||||
.name = "cast",
|
|
||||||
.type = FUNCTION_TYPE_CAST,
|
.type = FUNCTION_TYPE_CAST,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateCast,
|
.translateFunc = translateCast,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = castFunction,
|
.sprocessFunc = castFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "to_iso8601",
|
||||||
{
|
|
||||||
.name = "to_iso8601",
|
|
||||||
.type = FUNCTION_TYPE_TO_ISO8601,
|
.type = FUNCTION_TYPE_TO_ISO8601,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateToIso8601,
|
.translateFunc = translateToIso8601,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = toISO8601Function,
|
.sprocessFunc = toISO8601Function,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "to_unixtimestamp",
|
||||||
{
|
|
||||||
.name = "to_unixtimestamp",
|
|
||||||
.type = FUNCTION_TYPE_TO_UNIXTIMESTAMP,
|
.type = FUNCTION_TYPE_TO_UNIXTIMESTAMP,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateToUnixtimestamp,
|
.translateFunc = translateToUnixtimestamp,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = toUnixtimestampFunction,
|
.sprocessFunc = toUnixtimestampFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "timetruncate",
|
||||||
{
|
|
||||||
.name = "timetruncate",
|
|
||||||
.type = FUNCTION_TYPE_TIMETRUNCATE,
|
.type = FUNCTION_TYPE_TIMETRUNCATE,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateTimeTruncate,
|
.translateFunc = translateTimeTruncate,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = timeTruncateFunction,
|
.sprocessFunc = timeTruncateFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "timediff",
|
||||||
{
|
|
||||||
.name = "timediff",
|
|
||||||
.type = FUNCTION_TYPE_TIMEDIFF,
|
.type = FUNCTION_TYPE_TIMEDIFF,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateTimeDiff,
|
.translateFunc = translateTimeDiff,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = timeDiffFunction,
|
.sprocessFunc = timeDiffFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "now",
|
||||||
{
|
|
||||||
.name = "now",
|
|
||||||
.type = FUNCTION_TYPE_NOW,
|
.type = FUNCTION_TYPE_NOW,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
|
||||||
.translateFunc = translateTimePseudoColumn,
|
.translateFunc = translateTimePseudoColumn,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = nowFunction,
|
.sprocessFunc = nowFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "today",
|
||||||
{
|
|
||||||
.name = "today",
|
|
||||||
.type = FUNCTION_TYPE_TODAY,
|
.type = FUNCTION_TYPE_TODAY,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
|
||||||
.translateFunc = translateTimePseudoColumn,
|
.translateFunc = translateTimePseudoColumn,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = todayFunction,
|
.sprocessFunc = todayFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "timezone",
|
||||||
{
|
|
||||||
.name = "timezone",
|
|
||||||
.type = FUNCTION_TYPE_TIMEZONE,
|
.type = FUNCTION_TYPE_TIMEZONE,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateTimezone,
|
.translateFunc = translateTimezone,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = timezoneFunction,
|
.sprocessFunc = timezoneFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "_rowts",
|
||||||
{
|
|
||||||
.name = "_rowts",
|
|
||||||
.type = FUNCTION_TYPE_ROWTS,
|
.type = FUNCTION_TYPE_ROWTS,
|
||||||
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC,
|
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC,
|
||||||
.translateFunc = translateTimePseudoColumn,
|
.translateFunc = translateTimePseudoColumn,
|
||||||
.getEnvFunc = getTimePseudoFuncEnv,
|
.getEnvFunc = getTimePseudoFuncEnv,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = NULL,
|
.sprocessFunc = NULL,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "tbname",
|
||||||
{
|
|
||||||
.name = "tbname",
|
|
||||||
.type = FUNCTION_TYPE_TBNAME,
|
.type = FUNCTION_TYPE_TBNAME,
|
||||||
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC,
|
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC,
|
||||||
.translateFunc = translateTbnameColumn,
|
.translateFunc = translateTbnameColumn,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = NULL,
|
.sprocessFunc = NULL,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "_qstartts",
|
||||||
{
|
|
||||||
.name = "_qstartts",
|
|
||||||
.type = FUNCTION_TYPE_QSTARTTS,
|
.type = FUNCTION_TYPE_QSTARTTS,
|
||||||
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
||||||
.translateFunc = translateTimePseudoColumn,
|
.translateFunc = translateTimePseudoColumn,
|
||||||
.getEnvFunc = getTimePseudoFuncEnv,
|
.getEnvFunc = getTimePseudoFuncEnv,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = qStartTsFunction,
|
.sprocessFunc = qStartTsFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "_qendts",
|
||||||
{
|
|
||||||
.name = "_qendts",
|
|
||||||
.type = FUNCTION_TYPE_QENDTS,
|
.type = FUNCTION_TYPE_QENDTS,
|
||||||
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
||||||
.translateFunc = translateTimePseudoColumn,
|
.translateFunc = translateTimePseudoColumn,
|
||||||
.getEnvFunc = getTimePseudoFuncEnv,
|
.getEnvFunc = getTimePseudoFuncEnv,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = qEndTsFunction,
|
.sprocessFunc = qEndTsFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "_wstartts",
|
||||||
{
|
|
||||||
.name = "_wstartts",
|
|
||||||
.type = FUNCTION_TYPE_WSTARTTS,
|
.type = FUNCTION_TYPE_WSTARTTS,
|
||||||
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
||||||
.translateFunc = translateTimePseudoColumn,
|
.translateFunc = translateTimePseudoColumn,
|
||||||
.getEnvFunc = getTimePseudoFuncEnv,
|
.getEnvFunc = getTimePseudoFuncEnv,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = winStartTsFunction,
|
.sprocessFunc = winStartTsFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "_wendts",
|
||||||
{
|
|
||||||
.name = "_wendts",
|
|
||||||
.type = FUNCTION_TYPE_WENDTS,
|
.type = FUNCTION_TYPE_WENDTS,
|
||||||
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
||||||
.translateFunc = translateTimePseudoColumn,
|
.translateFunc = translateTimePseudoColumn,
|
||||||
.getEnvFunc = getTimePseudoFuncEnv,
|
.getEnvFunc = getTimePseudoFuncEnv,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = winEndTsFunction,
|
.sprocessFunc = winEndTsFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "_wduration",
|
||||||
{
|
|
||||||
.name = "_wduration",
|
|
||||||
.type = FUNCTION_TYPE_WDURATION,
|
.type = FUNCTION_TYPE_WDURATION,
|
||||||
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
|
||||||
.translateFunc = translateWduration,
|
.translateFunc = translateWduration,
|
||||||
.getEnvFunc = getTimePseudoFuncEnv,
|
.getEnvFunc = getTimePseudoFuncEnv,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = winDurFunction,
|
.sprocessFunc = winDurFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL},
|
||||||
},
|
{.name = "to_json",
|
||||||
{
|
|
||||||
.name = "to_json",
|
|
||||||
.type = FUNCTION_TYPE_TO_JSON,
|
.type = FUNCTION_TYPE_TO_JSON,
|
||||||
.classification = FUNC_MGT_SCALAR_FUNC,
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
.translateFunc = translateToJson,
|
.translateFunc = translateToJson,
|
||||||
.getEnvFunc = NULL,
|
.getEnvFunc = NULL,
|
||||||
.initFunc = NULL,
|
.initFunc = NULL,
|
||||||
.sprocessFunc = toJsonFunction,
|
.sprocessFunc = toJsonFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL}};
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const int32_t funcMgtBuiltinsNum = (sizeof(funcMgtBuiltins) / sizeof(SBuiltinFuncDefinition));
|
const int32_t funcMgtBuiltinsNum = (sizeof(funcMgtBuiltins) / sizeof(SBuiltinFuncDefinition));
|
||||||
|
|
Loading…
Reference in New Issue