add top getenv function for merge function
This commit is contained in:
parent
15ba5769e0
commit
b9cc1e6d09
|
@ -99,6 +99,7 @@ int32_t firstCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx);
|
||||||
int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx);
|
int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx);
|
||||||
|
|
||||||
bool getTopBotFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv);
|
bool getTopBotFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv);
|
||||||
|
bool getTopBotMergeFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv);
|
||||||
bool topBotFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo);
|
bool topBotFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo);
|
||||||
int32_t topFunction(SqlFunctionCtx *pCtx);
|
int32_t topFunction(SqlFunctionCtx *pCtx);
|
||||||
int32_t topFunctionMerge(SqlFunctionCtx *pCtx);
|
int32_t topFunctionMerge(SqlFunctionCtx *pCtx);
|
||||||
|
|
|
@ -1559,7 +1559,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
.type = FUNCTION_TYPE_TOP_MERGE,
|
.type = FUNCTION_TYPE_TOP_MERGE,
|
||||||
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_INDEFINITE_ROWS_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_INDEFINITE_ROWS_FUNC,
|
||||||
.translateFunc = translateTopBotMerge,
|
.translateFunc = translateTopBotMerge,
|
||||||
.getEnvFunc = getTopBotFuncEnv,
|
.getEnvFunc = getTopBotMergeFuncEnv,
|
||||||
.initFunc = functionSetup,
|
.initFunc = functionSetup,
|
||||||
.processFunc = topFunctionMerge,
|
.processFunc = topFunctionMerge,
|
||||||
.finalizeFunc = topBotFinalize,
|
.finalizeFunc = topBotFinalize,
|
||||||
|
|
|
@ -2661,6 +2661,12 @@ bool getTopBotFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool getTopBotFuncMergeEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) {
|
||||||
|
//intermediate result is binary and length contains VAR header size
|
||||||
|
pEnv->calcMemSize = pFunc->node.resType.bytes - VARSTR_HEADER_SIZE;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool topBotFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) {
|
bool topBotFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) {
|
||||||
if (!functionSetup(pCtx, pResInfo)) {
|
if (!functionSetup(pCtx, pResInfo)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue