“28692a51cc6718489202e8e820853da1f367e5bd”上不存在“src/connector/git@gitcode.net:taosdata/tdengine.git”
提交 cc231653 编写于 作者: X Xiaoyu Wang

enh: format code

上级 eccdc9b6
...@@ -50,7 +50,7 @@ static int32_t translateInOutNum(SFunctionNode* pFunc, char* pErrBuf, int32_t le ...@@ -50,7 +50,7 @@ static int32_t translateInOutNum(SFunctionNode* pFunc, char* pErrBuf, int32_t le
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[paraType].bytes, .type = paraType }; pFunc->node.resType = (SDataType){.bytes = tDataTypes[paraType].bytes, .type = paraType};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -65,7 +65,7 @@ static int32_t translateInNumOutDou(SFunctionNode* pFunc, char* pErrBuf, int32_t ...@@ -65,7 +65,7 @@ static int32_t translateInNumOutDou(SFunctionNode* pFunc, char* pErrBuf, int32_t
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE }; pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -81,7 +81,7 @@ static int32_t translateIn2NumOutDou(SFunctionNode* pFunc, char* pErrBuf, int32_ ...@@ -81,7 +81,7 @@ static int32_t translateIn2NumOutDou(SFunctionNode* pFunc, char* pErrBuf, int32_
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE }; pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -96,7 +96,7 @@ static int32_t translateInOutStr(SFunctionNode* pFunc, char* pErrBuf, int32_t le ...@@ -96,7 +96,7 @@ static int32_t translateInOutStr(SFunctionNode* pFunc, char* pErrBuf, int32_t le
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
pFunc->node.resType = (SDataType) { .bytes = pPara1->resType.bytes, .type = pPara1->resType.type }; pFunc->node.resType = (SDataType){.bytes = pPara1->resType.bytes, .type = pPara1->resType.type};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -126,7 +126,7 @@ static int32_t translateSum(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { ...@@ -126,7 +126,7 @@ static int32_t translateSum(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
} else if (IS_FLOAT_TYPE(paraType)) { } else if (IS_FLOAT_TYPE(paraType)) {
resType = TSDB_DATA_TYPE_DOUBLE; resType = TSDB_DATA_TYPE_DOUBLE;
} }
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[resType].bytes, .type = resType }; pFunc->node.resType = (SDataType){.bytes = tDataTypes[resType].bytes, .type = resType};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -143,9 +143,7 @@ static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, in ...@@ -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;
} }
...@@ -156,11 +154,11 @@ static int32_t translatePercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t ...@@ -156,11 +154,11 @@ static int32_t translatePercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t
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_NUMERIC_TYPE(para1Type) || (!IS_SIGNED_NUMERIC_TYPE(para2Type) && !IS_UNSIGNED_NUMERIC_TYPE(para2Type))) { if (!IS_NUMERIC_TYPE(para1Type) || (!IS_SIGNED_NUMERIC_TYPE(para2Type) && !IS_UNSIGNED_NUMERIC_TYPE(para2Type))) {
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE }; pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -168,7 +166,8 @@ static bool validAperventileAlgo(const SValueNode* pVal) { ...@@ -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,17 +184,19 @@ static int32_t translateApercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t ...@@ -185,17 +184,19 @@ 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'");
} }
} }
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE }; pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
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,11 +229,12 @@ static int32_t translateFirstLast(SFunctionNode* pFunc, char* pErrBuf, int32_t l ...@@ -228,11 +229,12 @@ 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;
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[paraType].bytes, .type = paraType }; pFunc->node.resType = (SDataType){.bytes = tDataTypes[paraType].bytes, .type = paraType};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -245,11 +247,13 @@ static int32_t translateLength(SFunctionNode* pFunc, char* pErrBuf, int32_t len) ...@@ -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);
...@@ -261,7 +265,7 @@ static int32_t translateConcatImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t ...@@ -261,7 +265,7 @@ static int32_t translateConcatImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t
/* For concat/concat_ws function, if params have NCHAR type, promote the final result to NCHAR */ /* For concat/concat_ws function, if params have NCHAR type, promote the final result to NCHAR */
for (int32_t i = 0; i < paraNum; ++i) { for (int32_t i = 0; i < paraNum; ++i) {
SNode* pPara = nodesListGetNode(pFunc->pParameterList, i); SNode* pPara = nodesListGetNode(pFunc->pParameterList, i);
uint8_t paraType = ((SExprNode*)pPara)->resType.type; uint8_t paraType = ((SExprNode*)pPara)->resType.type;
if (!IS_VAR_DATA_TYPE(paraType)) { if (!IS_VAR_DATA_TYPE(paraType)) {
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
...@@ -272,7 +276,7 @@ static int32_t translateConcatImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t ...@@ -272,7 +276,7 @@ static int32_t translateConcatImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t
} }
for (int32_t i = 0; i < paraNum; ++i) { for (int32_t i = 0; i < paraNum; ++i) {
SNode* pPara = nodesListGetNode(pFunc->pParameterList, i); SNode* pPara = nodesListGetNode(pFunc->pParameterList, i);
uint8_t paraType = ((SExprNode*)pPara)->resType.type; uint8_t paraType = ((SExprNode*)pPara)->resType.type;
int32_t paraBytes = ((SExprNode*)pPara)->resType.bytes; int32_t paraBytes = ((SExprNode*)pPara)->resType.bytes;
int32_t factor = 1; int32_t factor = 1;
...@@ -290,7 +294,7 @@ static int32_t translateConcatImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t ...@@ -290,7 +294,7 @@ static int32_t translateConcatImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t
resultBytes += sepBytes * (paraNum - 3); resultBytes += sepBytes * (paraNum - 3);
} }
pFunc->node.resType = (SDataType) { .bytes = resultBytes, .type = resultType }; pFunc->node.resType = (SDataType){.bytes = resultBytes, .type = resultType};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -309,7 +313,7 @@ static int32_t translateSubstr(SFunctionNode* pFunc, char* pErrBuf, int32_t len) ...@@ -309,7 +313,7 @@ static int32_t translateSubstr(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
} }
SExprNode* pPara1 = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 0); SExprNode* pPara1 = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 0);
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(pPara1->resType.type) || !IS_INTEGER_TYPE(para2Type)) { if (!IS_VAR_DATA_TYPE(pPara1->resType.type) || !IS_INTEGER_TYPE(para2Type)) {
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
...@@ -320,7 +324,7 @@ static int32_t translateSubstr(SFunctionNode* pFunc, char* pErrBuf, int32_t len) ...@@ -320,7 +324,7 @@ static int32_t translateSubstr(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
} }
} }
pFunc->node.resType = (SDataType) { .bytes = pPara1->resType.bytes, .type = pPara1->resType.type }; pFunc->node.resType = (SDataType){.bytes = pPara1->resType.bytes, .type = pPara1->resType.type};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -339,7 +343,7 @@ static int32_t translateCast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { ...@@ -339,7 +343,7 @@ static int32_t translateCast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
int32_t para2Bytes = pFunc->node.resType.bytes; int32_t para2Bytes = pFunc->node.resType.bytes;
if (para2Bytes <= 0 || para2Bytes > 1000) { //cast dst var type length limits to 1000 if (para2Bytes <= 0 || para2Bytes > 1000) { // cast dst var type length limits to 1000
return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName);
} }
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -355,7 +359,7 @@ static int32_t translateToIso8601(SFunctionNode* pFunc, char* pErrBuf, int32_t l ...@@ -355,7 +359,7 @@ static int32_t translateToIso8601(SFunctionNode* pFunc, char* pErrBuf, int32_t l
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
pFunc->node.resType = (SDataType) { .bytes = 64, .type = TSDB_DATA_TYPE_BINARY}; pFunc->node.resType = (SDataType){.bytes = 64, .type = TSDB_DATA_TYPE_BINARY};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -368,7 +372,7 @@ static int32_t translateToUnixtimestamp(SFunctionNode* pFunc, char* pErrBuf, int ...@@ -368,7 +372,7 @@ static int32_t translateToUnixtimestamp(SFunctionNode* pFunc, char* pErrBuf, int
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -379,11 +383,13 @@ static int32_t translateTimeTruncate(SFunctionNode* pFunc, char* pErrBuf, int32_ ...@@ -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;
} }
...@@ -406,7 +412,7 @@ static int32_t translateTimeDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t le ...@@ -406,7 +412,7 @@ static int32_t translateTimeDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t le
} }
} }
pFunc->node.resType = (SDataType) { .bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -420,545 +426,440 @@ static int32_t translateToJson(SFunctionNode* pFunc, char* pErrBuf, int32_t len) ...@@ -420,545 +426,440 @@ static int32_t translateToJson(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_BINARY].bytes, .type = TSDB_DATA_TYPE_BINARY}; pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BINARY].bytes, .type = TSDB_DATA_TYPE_BINARY};
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
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, .dataRequiredFunc = countDataRequired,
.dataRequiredFunc = countDataRequired, .getEnvFunc = getCountFuncEnv,
.getEnvFunc = getCountFuncEnv, .initFunc = functionSetup,
.initFunc = functionSetup, .processFunc = countFunction,
.processFunc = countFunction, .finalizeFunc = functionFinalize},
.finalizeFunc = functionFinalize {.name = "sum",
}, .type = FUNCTION_TYPE_SUM,
{ .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
.name = "sum", .translateFunc = translateSum,
.type = FUNCTION_TYPE_SUM, .dataRequiredFunc = statisDataRequired,
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED, .getEnvFunc = getSumFuncEnv,
.translateFunc = translateSum, .initFunc = functionSetup,
.dataRequiredFunc = statisDataRequired, .processFunc = sumFunction,
.getEnvFunc = getSumFuncEnv, .finalizeFunc = functionFinalize},
.initFunc = functionSetup, {.name = "min",
.processFunc = sumFunction, .type = FUNCTION_TYPE_MIN,
.finalizeFunc = functionFinalize .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
}, .translateFunc = translateInOutNum,
{ .dataRequiredFunc = statisDataRequired,
.name = "min", .getEnvFunc = getMinmaxFuncEnv,
.type = FUNCTION_TYPE_MIN, .initFunc = minFunctionSetup,
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED, .processFunc = minFunction,
.translateFunc = translateInOutNum, .finalizeFunc = functionFinalize},
.dataRequiredFunc = statisDataRequired, {.name = "max",
.getEnvFunc = getMinmaxFuncEnv, .type = FUNCTION_TYPE_MAX,
.initFunc = minFunctionSetup, .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED,
.processFunc = minFunction, .translateFunc = translateInOutNum,
.finalizeFunc = functionFinalize .dataRequiredFunc = statisDataRequired,
}, .getEnvFunc = getMinmaxFuncEnv,
{ .initFunc = maxFunctionSetup,
.name = "max", .processFunc = maxFunction,
.type = FUNCTION_TYPE_MAX, .finalizeFunc = functionFinalize},
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SPECIAL_DATA_REQUIRED, {.name = "stddev",
.translateFunc = translateInOutNum, .type = FUNCTION_TYPE_STDDEV,
.dataRequiredFunc = statisDataRequired, .classification = FUNC_MGT_AGG_FUNC,
.getEnvFunc = getMinmaxFuncEnv, .translateFunc = translateInNumOutDou,
.initFunc = maxFunctionSetup, .getEnvFunc = getStddevFuncEnv,
.processFunc = maxFunction, .initFunc = stddevFunctionSetup,
.finalizeFunc = functionFinalize .processFunc = stddevFunction,
}, .finalizeFunc = stddevFinalize},
{ {.name = "avg",
.name = "stddev", .type = FUNCTION_TYPE_AVG,
.type = FUNCTION_TYPE_STDDEV, .classification = FUNC_MGT_AGG_FUNC,
.classification = FUNC_MGT_AGG_FUNC, .translateFunc = translateInNumOutDou,
.translateFunc = translateInNumOutDou, .getEnvFunc = getAvgFuncEnv,
.getEnvFunc = getStddevFuncEnv, .initFunc = avgFunctionSetup,
.initFunc = stddevFunctionSetup, .processFunc = avgFunction,
.processFunc = stddevFunction, .finalizeFunc = avgFinalize},
.finalizeFunc = stddevFinalize {.name = "percentile",
}, .type = FUNCTION_TYPE_PERCENTILE,
{ .classification = FUNC_MGT_AGG_FUNC,
.name = "avg", .translateFunc = translatePercentile,
.type = FUNCTION_TYPE_AVG, .getEnvFunc = getPercentileFuncEnv,
.classification = FUNC_MGT_AGG_FUNC, .initFunc = percentileFunctionSetup,
.translateFunc = translateInNumOutDou, .processFunc = percentileFunction,
.getEnvFunc = getAvgFuncEnv, .finalizeFunc = percentileFinalize},
.initFunc = avgFunctionSetup, {.name = "apercentile",
.processFunc = avgFunction, .type = FUNCTION_TYPE_APERCENTILE,
.finalizeFunc = avgFinalize .classification = FUNC_MGT_AGG_FUNC,
}, .translateFunc = translateApercentile,
{ .getEnvFunc = getMinmaxFuncEnv,
.name = "percentile", .initFunc = maxFunctionSetup,
.type = FUNCTION_TYPE_PERCENTILE, .processFunc = maxFunction,
.classification = FUNC_MGT_AGG_FUNC, .finalizeFunc = functionFinalize},
.translateFunc = translatePercentile, {
.getEnvFunc = getPercentileFuncEnv, .name = "top",
.initFunc = percentileFunctionSetup, .type = FUNCTION_TYPE_TOP,
.processFunc = percentileFunction, .classification = FUNC_MGT_AGG_FUNC,
.finalizeFunc = percentileFinalize .translateFunc = translateTop,
}, .getEnvFunc = getTopBotFuncEnv,
{ .initFunc = functionSetup,
.name = "apercentile", .processFunc = topFunction,
.type = FUNCTION_TYPE_APERCENTILE, .finalizeFunc = topBotFinalize,
.classification = FUNC_MGT_AGG_FUNC, },
.translateFunc = translateApercentile, {.name = "bottom",
.getEnvFunc = getMinmaxFuncEnv, .type = FUNCTION_TYPE_BOTTOM,
.initFunc = maxFunctionSetup, .classification = FUNC_MGT_AGG_FUNC,
.processFunc = maxFunction, .translateFunc = translateBottom,
.finalizeFunc = functionFinalize .getEnvFunc = getMinmaxFuncEnv,
}, .initFunc = maxFunctionSetup,
{ .processFunc = maxFunction,
.name = "top", .finalizeFunc = functionFinalize},
.type = FUNCTION_TYPE_TOP, {.name = "spread",
.classification = FUNC_MGT_AGG_FUNC, .type = FUNCTION_TYPE_SPREAD,
.translateFunc = translateTop, .classification = FUNC_MGT_AGG_FUNC,
.getEnvFunc = getTopBotFuncEnv, .translateFunc = translateSpread,
.initFunc = functionSetup, .getEnvFunc = getMinmaxFuncEnv,
.processFunc = topFunction, .initFunc = maxFunctionSetup,
.finalizeFunc = topBotFinalize, .processFunc = maxFunction,
}, .finalizeFunc = functionFinalize},
{ {.name = "last_row",
.name = "bottom", .type = FUNCTION_TYPE_LAST_ROW,
.type = FUNCTION_TYPE_BOTTOM, .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
.classification = FUNC_MGT_AGG_FUNC, .translateFunc = translateLastRow,
.translateFunc = translateBottom, .getEnvFunc = getMinmaxFuncEnv,
.getEnvFunc = getMinmaxFuncEnv, .initFunc = maxFunctionSetup,
.initFunc = maxFunctionSetup, .processFunc = maxFunction,
.processFunc = maxFunction, .finalizeFunc = functionFinalize},
.finalizeFunc = functionFinalize {.name = "first",
}, .type = FUNCTION_TYPE_FIRST,
{ .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
.name = "spread", .translateFunc = translateFirstLast,
.type = FUNCTION_TYPE_SPREAD, .getEnvFunc = getFirstLastFuncEnv,
.classification = FUNC_MGT_AGG_FUNC, .initFunc = functionSetup,
.translateFunc = translateSpread, .processFunc = firstFunction,
.getEnvFunc = getMinmaxFuncEnv, .finalizeFunc = functionFinalize},
.initFunc = maxFunctionSetup, {.name = "last",
.processFunc = maxFunction, .type = FUNCTION_TYPE_LAST,
.finalizeFunc = functionFinalize .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC,
}, .translateFunc = translateFirstLast,
{ .getEnvFunc = getFirstLastFuncEnv,
.name = "last_row", .initFunc = functionSetup,
.type = FUNCTION_TYPE_LAST_ROW, .processFunc = lastFunction,
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC, .finalizeFunc = functionFinalize},
.translateFunc = translateLastRow, {.name = "diff",
.getEnvFunc = getMinmaxFuncEnv, .type = FUNCTION_TYPE_DIFF,
.initFunc = maxFunctionSetup, .classification = FUNC_MGT_NONSTANDARD_SQL_FUNC,
.processFunc = maxFunction, .translateFunc = translateInOutNum,
.finalizeFunc = functionFinalize .getEnvFunc = getDiffFuncEnv,
}, .initFunc = diffFunctionSetup,
{ .processFunc = diffFunction,
.name = "first", .finalizeFunc = functionFinalize},
.type = FUNCTION_TYPE_FIRST, {.name = "abs",
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC, .type = FUNCTION_TYPE_ABS,
.translateFunc = translateFirstLast, .classification = FUNC_MGT_SCALAR_FUNC,
.getEnvFunc = getFirstLastFuncEnv, .translateFunc = translateInOutNum,
.initFunc = functionSetup, .getEnvFunc = NULL,
.processFunc = firstFunction, .initFunc = NULL,
.finalizeFunc = functionFinalize .sprocessFunc = absFunction,
}, .finalizeFunc = NULL},
{ {.name = "log",
.name = "last", .type = FUNCTION_TYPE_LOG,
.type = FUNCTION_TYPE_LAST, .classification = FUNC_MGT_SCALAR_FUNC,
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC, .translateFunc = translateIn2NumOutDou,
.translateFunc = translateFirstLast, .getEnvFunc = NULL,
.getEnvFunc = getFirstLastFuncEnv, .initFunc = NULL,
.initFunc = functionSetup, .sprocessFunc = logFunction,
.processFunc = lastFunction, .finalizeFunc = NULL},
.finalizeFunc = functionFinalize {.name = "pow",
}, .type = FUNCTION_TYPE_POW,
{ .classification = FUNC_MGT_SCALAR_FUNC,
.name = "diff", .translateFunc = translateIn2NumOutDou,
.type = FUNCTION_TYPE_DIFF, .getEnvFunc = NULL,
.classification = FUNC_MGT_NONSTANDARD_SQL_FUNC, .initFunc = NULL,
.translateFunc = translateInOutNum, .sprocessFunc = powFunction,
.getEnvFunc = getDiffFuncEnv, .finalizeFunc = NULL},
.initFunc = diffFunctionSetup, {.name = "sqrt",
.processFunc = diffFunction, .type = FUNCTION_TYPE_SQRT,
.finalizeFunc = functionFinalize .classification = FUNC_MGT_SCALAR_FUNC,
}, .translateFunc = translateInNumOutDou,
{ .getEnvFunc = NULL,
.name = "abs", .initFunc = NULL,
.type = FUNCTION_TYPE_ABS, .sprocessFunc = sqrtFunction,
.classification = FUNC_MGT_SCALAR_FUNC, .finalizeFunc = NULL},
.translateFunc = translateInOutNum, {.name = "ceil",
.getEnvFunc = NULL, .type = FUNCTION_TYPE_CEIL,
.initFunc = NULL, .classification = FUNC_MGT_SCALAR_FUNC,
.sprocessFunc = absFunction, .translateFunc = translateInOutNum,
.finalizeFunc = NULL .getEnvFunc = NULL,
}, .initFunc = NULL,
{ .sprocessFunc = ceilFunction,
.name = "log", .finalizeFunc = NULL},
.type = FUNCTION_TYPE_LOG, {.name = "floor",
.classification = FUNC_MGT_SCALAR_FUNC, .type = FUNCTION_TYPE_FLOOR,
.translateFunc = translateIn2NumOutDou, .classification = FUNC_MGT_SCALAR_FUNC,
.getEnvFunc = NULL, .translateFunc = translateInOutNum,
.initFunc = NULL, .getEnvFunc = NULL,
.sprocessFunc = logFunction, .initFunc = NULL,
.finalizeFunc = NULL .sprocessFunc = floorFunction,
}, .finalizeFunc = NULL},
{ {.name = "round",
.name = "pow", .type = FUNCTION_TYPE_ROUND,
.type = FUNCTION_TYPE_POW, .classification = FUNC_MGT_SCALAR_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC, .translateFunc = translateInOutNum,
.translateFunc = translateIn2NumOutDou, .getEnvFunc = NULL,
.getEnvFunc = NULL, .initFunc = NULL,
.initFunc = NULL, .sprocessFunc = roundFunction,
.sprocessFunc = powFunction, .finalizeFunc = NULL},
.finalizeFunc = NULL {.name = "sin",
}, .type = FUNCTION_TYPE_SIN,
{ .classification = FUNC_MGT_SCALAR_FUNC,
.name = "sqrt", .translateFunc = translateInNumOutDou,
.type = FUNCTION_TYPE_SQRT, .getEnvFunc = NULL,
.classification = FUNC_MGT_SCALAR_FUNC, .initFunc = NULL,
.translateFunc = translateInNumOutDou, .sprocessFunc = sinFunction,
.getEnvFunc = NULL, .finalizeFunc = NULL},
.initFunc = NULL, {.name = "cos",
.sprocessFunc = sqrtFunction, .type = FUNCTION_TYPE_COS,
.finalizeFunc = NULL .classification = FUNC_MGT_SCALAR_FUNC,
}, .translateFunc = translateInNumOutDou,
{ .getEnvFunc = NULL,
.name = "ceil", .initFunc = NULL,
.type = FUNCTION_TYPE_CEIL, .sprocessFunc = cosFunction,
.classification = FUNC_MGT_SCALAR_FUNC, .finalizeFunc = NULL},
.translateFunc = translateInOutNum, {.name = "tan",
.getEnvFunc = NULL, .type = FUNCTION_TYPE_TAN,
.initFunc = NULL, .classification = FUNC_MGT_SCALAR_FUNC,
.sprocessFunc = ceilFunction, .translateFunc = translateInNumOutDou,
.finalizeFunc = NULL .getEnvFunc = NULL,
}, .initFunc = NULL,
{ .sprocessFunc = tanFunction,
.name = "floor", .finalizeFunc = NULL},
.type = FUNCTION_TYPE_FLOOR, {.name = "asin",
.classification = FUNC_MGT_SCALAR_FUNC, .type = FUNCTION_TYPE_ASIN,
.translateFunc = translateInOutNum, .classification = FUNC_MGT_SCALAR_FUNC,
.getEnvFunc = NULL, .translateFunc = translateInNumOutDou,
.initFunc = NULL, .getEnvFunc = NULL,
.sprocessFunc = floorFunction, .initFunc = NULL,
.finalizeFunc = NULL .sprocessFunc = asinFunction,
}, .finalizeFunc = NULL},
{ {.name = "acos",
.name = "round", .type = FUNCTION_TYPE_ACOS,
.type = FUNCTION_TYPE_ROUND, .classification = FUNC_MGT_SCALAR_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC, .translateFunc = translateInNumOutDou,
.translateFunc = translateInOutNum, .getEnvFunc = NULL,
.getEnvFunc = NULL, .initFunc = NULL,
.initFunc = NULL, .sprocessFunc = acosFunction,
.sprocessFunc = roundFunction, .finalizeFunc = NULL},
.finalizeFunc = NULL {.name = "atan",
}, .type = FUNCTION_TYPE_ATAN,
{ .classification = FUNC_MGT_SCALAR_FUNC,
.name = "sin", .translateFunc = translateInNumOutDou,
.type = FUNCTION_TYPE_SIN, .getEnvFunc = NULL,
.classification = FUNC_MGT_SCALAR_FUNC, .initFunc = NULL,
.translateFunc = translateInNumOutDou, .sprocessFunc = atanFunction,
.getEnvFunc = NULL, .finalizeFunc = NULL},
.initFunc = NULL, {.name = "length",
.sprocessFunc = sinFunction, .type = FUNCTION_TYPE_LENGTH,
.finalizeFunc = NULL .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
}, .translateFunc = translateLength,
{ .getEnvFunc = NULL,
.name = "cos", .initFunc = NULL,
.type = FUNCTION_TYPE_COS, .sprocessFunc = lengthFunction,
.classification = FUNC_MGT_SCALAR_FUNC, .finalizeFunc = NULL},
.translateFunc = translateInNumOutDou, {.name = "char_length",
.getEnvFunc = NULL, .type = FUNCTION_TYPE_CHAR_LENGTH,
.initFunc = NULL, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
.sprocessFunc = cosFunction, .translateFunc = translateLength,
.finalizeFunc = NULL .getEnvFunc = NULL,
}, .initFunc = NULL,
{ .sprocessFunc = charLengthFunction,
.name = "tan", .finalizeFunc = NULL},
.type = FUNCTION_TYPE_TAN, {.name = "concat",
.classification = FUNC_MGT_SCALAR_FUNC, .type = FUNCTION_TYPE_CONCAT,
.translateFunc = translateInNumOutDou, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
.getEnvFunc = NULL, .translateFunc = translateConcat,
.initFunc = NULL, .getEnvFunc = NULL,
.sprocessFunc = tanFunction, .initFunc = NULL,
.finalizeFunc = NULL .sprocessFunc = concatFunction,
}, .finalizeFunc = NULL},
{ {.name = "concat_ws",
.name = "asin", .type = FUNCTION_TYPE_CONCAT_WS,
.type = FUNCTION_TYPE_ASIN, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC, .translateFunc = translateConcatWs,
.translateFunc = translateInNumOutDou, .getEnvFunc = NULL,
.getEnvFunc = NULL, .initFunc = NULL,
.initFunc = NULL, .sprocessFunc = concatWsFunction,
.sprocessFunc = asinFunction, .finalizeFunc = NULL},
.finalizeFunc = NULL {.name = "lower",
}, .type = FUNCTION_TYPE_LOWER,
{ .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
.name = "acos", .translateFunc = translateInOutStr,
.type = FUNCTION_TYPE_ACOS, .getEnvFunc = NULL,
.classification = FUNC_MGT_SCALAR_FUNC, .initFunc = NULL,
.translateFunc = translateInNumOutDou, .sprocessFunc = lowerFunction,
.getEnvFunc = NULL, .finalizeFunc = NULL},
.initFunc = NULL, {.name = "upper",
.sprocessFunc = acosFunction, .type = FUNCTION_TYPE_UPPER,
.finalizeFunc = NULL .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
}, .translateFunc = translateInOutStr,
{ .getEnvFunc = NULL,
.name = "atan", .initFunc = NULL,
.type = FUNCTION_TYPE_ATAN, .sprocessFunc = upperFunction,
.classification = FUNC_MGT_SCALAR_FUNC, .finalizeFunc = NULL},
.translateFunc = translateInNumOutDou, {.name = "ltrim",
.getEnvFunc = NULL, .type = FUNCTION_TYPE_LTRIM,
.initFunc = NULL, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
.sprocessFunc = atanFunction, .translateFunc = translateInOutStr,
.finalizeFunc = NULL .getEnvFunc = NULL,
}, .initFunc = NULL,
{ .sprocessFunc = ltrimFunction,
.name = "length", .finalizeFunc = NULL},
.type = FUNCTION_TYPE_LENGTH, {.name = "rtrim",
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .type = FUNCTION_TYPE_RTRIM,
.translateFunc = translateLength, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
.getEnvFunc = NULL, .translateFunc = translateInOutStr,
.initFunc = NULL, .getEnvFunc = NULL,
.sprocessFunc = lengthFunction, .initFunc = NULL,
.finalizeFunc = NULL .sprocessFunc = rtrimFunction,
}, .finalizeFunc = NULL},
{ {.name = "substr",
.name = "char_length", .type = FUNCTION_TYPE_SUBSTR,
.type = FUNCTION_TYPE_CHAR_LENGTH, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .translateFunc = translateSubstr,
.translateFunc = translateLength, .getEnvFunc = NULL,
.getEnvFunc = NULL, .initFunc = NULL,
.initFunc = NULL, .sprocessFunc = substrFunction,
.sprocessFunc = charLengthFunction, .finalizeFunc = NULL},
.finalizeFunc = NULL {.name = "cast",
}, .type = FUNCTION_TYPE_CAST,
{ .classification = FUNC_MGT_SCALAR_FUNC,
.name = "concat", .translateFunc = translateCast,
.type = FUNCTION_TYPE_CONCAT, .getEnvFunc = NULL,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .initFunc = NULL,
.translateFunc = translateConcat, .sprocessFunc = castFunction,
.getEnvFunc = NULL, .finalizeFunc = NULL},
.initFunc = NULL, {.name = "to_iso8601",
.sprocessFunc = concatFunction, .type = FUNCTION_TYPE_TO_ISO8601,
.finalizeFunc = NULL .classification = FUNC_MGT_SCALAR_FUNC,
}, .translateFunc = translateToIso8601,
{ .getEnvFunc = NULL,
.name = "concat_ws", .initFunc = NULL,
.type = FUNCTION_TYPE_CONCAT_WS, .sprocessFunc = toISO8601Function,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .finalizeFunc = NULL},
.translateFunc = translateConcatWs, {.name = "to_unixtimestamp",
.getEnvFunc = NULL, .type = FUNCTION_TYPE_TO_UNIXTIMESTAMP,
.initFunc = NULL, .classification = FUNC_MGT_SCALAR_FUNC,
.sprocessFunc = concatWsFunction, .translateFunc = translateToUnixtimestamp,
.finalizeFunc = NULL .getEnvFunc = NULL,
}, .initFunc = NULL,
{ .sprocessFunc = toUnixtimestampFunction,
.name = "lower", .finalizeFunc = NULL},
.type = FUNCTION_TYPE_LOWER, {.name = "timetruncate",
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .type = FUNCTION_TYPE_TIMETRUNCATE,
.translateFunc = translateInOutStr, .classification = FUNC_MGT_SCALAR_FUNC,
.getEnvFunc = NULL, .translateFunc = translateTimeTruncate,
.initFunc = NULL, .getEnvFunc = NULL,
.sprocessFunc = lowerFunction, .initFunc = NULL,
.finalizeFunc = NULL .sprocessFunc = timeTruncateFunction,
}, .finalizeFunc = NULL},
{ {.name = "timediff",
.name = "upper", .type = FUNCTION_TYPE_TIMEDIFF,
.type = FUNCTION_TYPE_UPPER, .classification = FUNC_MGT_SCALAR_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .translateFunc = translateTimeDiff,
.translateFunc = translateInOutStr, .getEnvFunc = NULL,
.getEnvFunc = NULL, .initFunc = NULL,
.initFunc = NULL, .sprocessFunc = timeDiffFunction,
.sprocessFunc = upperFunction, .finalizeFunc = NULL},
.finalizeFunc = NULL {.name = "now",
}, .type = FUNCTION_TYPE_NOW,
{ .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
.name = "ltrim", .translateFunc = translateTimePseudoColumn,
.type = FUNCTION_TYPE_LTRIM, .getEnvFunc = NULL,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .initFunc = NULL,
.translateFunc = translateInOutStr, .sprocessFunc = nowFunction,
.getEnvFunc = NULL, .finalizeFunc = NULL},
.initFunc = NULL, {.name = "today",
.sprocessFunc = ltrimFunction, .type = FUNCTION_TYPE_TODAY,
.finalizeFunc = NULL .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
}, .translateFunc = translateTimePseudoColumn,
{ .getEnvFunc = NULL,
.name = "rtrim", .initFunc = NULL,
.type = FUNCTION_TYPE_RTRIM, .sprocessFunc = todayFunction,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .finalizeFunc = NULL},
.translateFunc = translateInOutStr, {.name = "timezone",
.getEnvFunc = NULL, .type = FUNCTION_TYPE_TIMEZONE,
.initFunc = NULL, .classification = FUNC_MGT_SCALAR_FUNC,
.sprocessFunc = rtrimFunction, .translateFunc = translateTimezone,
.finalizeFunc = NULL .getEnvFunc = NULL,
}, .initFunc = NULL,
{ .sprocessFunc = timezoneFunction,
.name = "substr", .finalizeFunc = NULL},
.type = FUNCTION_TYPE_SUBSTR, {.name = "_rowts",
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, .type = FUNCTION_TYPE_ROWTS,
.translateFunc = translateSubstr, .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC,
.getEnvFunc = NULL, .translateFunc = translateTimePseudoColumn,
.initFunc = NULL, .getEnvFunc = getTimePseudoFuncEnv,
.sprocessFunc = substrFunction, .initFunc = NULL,
.finalizeFunc = NULL .sprocessFunc = NULL,
}, .finalizeFunc = NULL},
{ {.name = "tbname",
.name = "cast", .type = FUNCTION_TYPE_TBNAME,
.type = FUNCTION_TYPE_CAST, .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC, .translateFunc = translateTbnameColumn,
.translateFunc = translateCast, .getEnvFunc = NULL,
.getEnvFunc = NULL, .initFunc = NULL,
.initFunc = NULL, .sprocessFunc = NULL,
.sprocessFunc = castFunction, .finalizeFunc = NULL},
.finalizeFunc = NULL {.name = "_qstartts",
}, .type = FUNCTION_TYPE_QSTARTTS,
{ .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.name = "to_iso8601", .translateFunc = translateTimePseudoColumn,
.type = FUNCTION_TYPE_TO_ISO8601, .getEnvFunc = getTimePseudoFuncEnv,
.classification = FUNC_MGT_SCALAR_FUNC, .initFunc = NULL,
.translateFunc = translateToIso8601, .sprocessFunc = qStartTsFunction,
.getEnvFunc = NULL, .finalizeFunc = NULL},
.initFunc = NULL, {.name = "_qendts",
.sprocessFunc = toISO8601Function, .type = FUNCTION_TYPE_QENDTS,
.finalizeFunc = NULL .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
}, .translateFunc = translateTimePseudoColumn,
{ .getEnvFunc = getTimePseudoFuncEnv,
.name = "to_unixtimestamp", .initFunc = NULL,
.type = FUNCTION_TYPE_TO_UNIXTIMESTAMP, .sprocessFunc = qEndTsFunction,
.classification = FUNC_MGT_SCALAR_FUNC, .finalizeFunc = NULL},
.translateFunc = translateToUnixtimestamp, {.name = "_wstartts",
.getEnvFunc = NULL, .type = FUNCTION_TYPE_WSTARTTS,
.initFunc = NULL, .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.sprocessFunc = toUnixtimestampFunction, .translateFunc = translateTimePseudoColumn,
.finalizeFunc = NULL .getEnvFunc = getTimePseudoFuncEnv,
}, .initFunc = NULL,
{ .sprocessFunc = winStartTsFunction,
.name = "timetruncate", .finalizeFunc = NULL},
.type = FUNCTION_TYPE_TIMETRUNCATE, {.name = "_wendts",
.classification = FUNC_MGT_SCALAR_FUNC, .type = FUNCTION_TYPE_WENDTS,
.translateFunc = translateTimeTruncate, .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.getEnvFunc = NULL, .translateFunc = translateTimePseudoColumn,
.initFunc = NULL, .getEnvFunc = getTimePseudoFuncEnv,
.sprocessFunc = timeTruncateFunction, .initFunc = NULL,
.finalizeFunc = NULL .sprocessFunc = winEndTsFunction,
}, .finalizeFunc = NULL},
{ {.name = "_wduration",
.name = "timediff", .type = FUNCTION_TYPE_WDURATION,
.type = FUNCTION_TYPE_TIMEDIFF, .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.classification = FUNC_MGT_SCALAR_FUNC, .translateFunc = translateWduration,
.translateFunc = translateTimeDiff, .getEnvFunc = getTimePseudoFuncEnv,
.getEnvFunc = NULL, .initFunc = NULL,
.initFunc = NULL, .sprocessFunc = winDurFunction,
.sprocessFunc = timeDiffFunction, .finalizeFunc = NULL},
.finalizeFunc = NULL {.name = "to_json",
}, .type = FUNCTION_TYPE_TO_JSON,
{ .classification = FUNC_MGT_SCALAR_FUNC,
.name = "now", .translateFunc = translateToJson,
.type = FUNCTION_TYPE_NOW, .getEnvFunc = NULL,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC, .initFunc = NULL,
.translateFunc = translateTimePseudoColumn, .sprocessFunc = toJsonFunction,
.getEnvFunc = NULL, .finalizeFunc = NULL}};
.initFunc = NULL,
.sprocessFunc = nowFunction,
.finalizeFunc = NULL
},
{
.name = "today",
.type = FUNCTION_TYPE_TODAY,
.classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC,
.translateFunc = translateTimePseudoColumn,
.getEnvFunc = NULL,
.initFunc = NULL,
.sprocessFunc = todayFunction,
.finalizeFunc = NULL
},
{
.name = "timezone",
.type = FUNCTION_TYPE_TIMEZONE,
.classification = FUNC_MGT_SCALAR_FUNC,
.translateFunc = translateTimezone,
.getEnvFunc = NULL,
.initFunc = NULL,
.sprocessFunc = timezoneFunction,
.finalizeFunc = NULL
},
{
.name = "_rowts",
.type = FUNCTION_TYPE_ROWTS,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC,
.translateFunc = translateTimePseudoColumn,
.getEnvFunc = getTimePseudoFuncEnv,
.initFunc = NULL,
.sprocessFunc = NULL,
.finalizeFunc = NULL
},
{
.name = "tbname",
.type = FUNCTION_TYPE_TBNAME,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC,
.translateFunc = translateTbnameColumn,
.getEnvFunc = NULL,
.initFunc = NULL,
.sprocessFunc = NULL,
.finalizeFunc = NULL
},
{
.name = "_qstartts",
.type = FUNCTION_TYPE_QSTARTTS,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.translateFunc = translateTimePseudoColumn,
.getEnvFunc = getTimePseudoFuncEnv,
.initFunc = NULL,
.sprocessFunc = qStartTsFunction,
.finalizeFunc = NULL
},
{
.name = "_qendts",
.type = FUNCTION_TYPE_QENDTS,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.translateFunc = translateTimePseudoColumn,
.getEnvFunc = getTimePseudoFuncEnv,
.initFunc = NULL,
.sprocessFunc = qEndTsFunction,
.finalizeFunc = NULL
},
{
.name = "_wstartts",
.type = FUNCTION_TYPE_WSTARTTS,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.translateFunc = translateTimePseudoColumn,
.getEnvFunc = getTimePseudoFuncEnv,
.initFunc = NULL,
.sprocessFunc = winStartTsFunction,
.finalizeFunc = NULL
},
{
.name = "_wendts",
.type = FUNCTION_TYPE_WENDTS,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.translateFunc = translateTimePseudoColumn,
.getEnvFunc = getTimePseudoFuncEnv,
.initFunc = NULL,
.sprocessFunc = winEndTsFunction,
.finalizeFunc = NULL
},
{
.name = "_wduration",
.type = FUNCTION_TYPE_WDURATION,
.classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC,
.translateFunc = translateWduration,
.getEnvFunc = getTimePseudoFuncEnv,
.initFunc = NULL,
.sprocessFunc = winDurFunction,
.finalizeFunc = NULL
},
{
.name = "to_json",
.type = FUNCTION_TYPE_TO_JSON,
.classification = FUNC_MGT_SCALAR_FUNC,
.translateFunc = translateToJson,
.getEnvFunc = NULL,
.initFunc = NULL,
.sprocessFunc = toJsonFunction,
.finalizeFunc = NULL
}
};
const int32_t funcMgtBuiltinsNum = (sizeof(funcMgtBuiltins) / sizeof(SBuiltinFuncDefinition)); const int32_t funcMgtBuiltinsNum = (sizeof(funcMgtBuiltins) / sizeof(SBuiltinFuncDefinition));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册