提交 3a6be84b 编写于 作者: H Haojun Liao

[td-13039] support group by.

上级 ef50049a
...@@ -41,6 +41,8 @@ bool getFirstLastFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv); ...@@ -41,6 +41,8 @@ bool getFirstLastFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv);
void firstFunction(SqlFunctionCtx *pCtx); void firstFunction(SqlFunctionCtx *pCtx);
void lastFunction(SqlFunctionCtx *pCtx); void lastFunction(SqlFunctionCtx *pCtx);
void valFunction(SqlFunctionCtx *pCtx);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -81,6 +81,16 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { ...@@ -81,6 +81,16 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.processFunc = lastFunction, .processFunc = lastFunction,
.finalizeFunc = functionFinalizer .finalizeFunc = functionFinalizer
}, },
// {
// .name = "valueAssigner",
// .type = FUNCTION_TYPE_ASSIGNER,
// .classification = FUNC_MGT_AGG_FUNC,
// .checkFunc = stubCheckAndGetResultType,
// .getEnvFunc = getFirstLastFuncEnv,
// .initFunc = functionSetup,
// .processFunc = valFunction,
// .finalizeFunc = functionFinalizer
// },
{ {
.name = "concat", .name = "concat",
.type = FUNCTION_TYPE_CONCAT, .type = FUNCTION_TYPE_CONCAT,
......
...@@ -554,3 +554,11 @@ void lastFunction(SqlFunctionCtx *pCtx) { ...@@ -554,3 +554,11 @@ void lastFunction(SqlFunctionCtx *pCtx) {
SET_VAL(pResInfo, numOfElems, 1); SET_VAL(pResInfo, numOfElems, 1);
} }
void valFunction(SqlFunctionCtx *pCtx) {
SResultRowEntryInfo *pResInfo = GET_RES_INFO(pCtx);
char* buf = GET_ROWCELL_INTERBUF(pResInfo);
SColumnInfoData* pInputCol = pCtx->input.pData[0];
memcpy(buf, pInputCol->pData, pInputCol->info.bytes);
}
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
./test.sh -f tsim/dnode/basic1.sim ./test.sh -f tsim/dnode/basic1.sim
# ---- insert # ---- insert
./test.sh -f tsim/insert/basic0.sim #./test.sh -f tsim/insert/basic0.sim
# ---- query # ---- query
./test.sh -f tsim/query/interval.sim ./test.sh -f tsim/query/interval.sim
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册