Merge pull request #17772 from taosdata/feature/TD-19893
fix(planner):add semantic check
This commit is contained in:
commit
a0c7b7d512
|
@ -674,6 +674,10 @@ static bool isSelectFunc(const SNode* pNode) {
|
|||
return (QUERY_NODE_FUNCTION == nodeType(pNode) && fmIsSelectFunc(((SFunctionNode*)pNode)->funcId));
|
||||
}
|
||||
|
||||
static bool isWindowPseudoColumnFunc(const SNode* pNode) {
|
||||
return (QUERY_NODE_FUNCTION == nodeType(pNode) && fmIsWindowPseudoColumnFunc(((SFunctionNode*)pNode)->funcId));
|
||||
}
|
||||
|
||||
static bool isTimelineFunc(const SNode* pNode) {
|
||||
return (QUERY_NODE_FUNCTION == nodeType(pNode) && fmIsTimelineFunc(((SFunctionNode*)pNode)->funcId));
|
||||
}
|
||||
|
@ -1264,10 +1268,7 @@ static EDealRes translateOperator(STranslateContext* pCxt, SOperatorNode* pOp) {
|
|||
}
|
||||
|
||||
static EDealRes haveVectorFunction(SNode* pNode, void* pContext) {
|
||||
if (isAggFunc(pNode)) {
|
||||
*((bool*)pContext) = true;
|
||||
return DEAL_RES_END;
|
||||
} else if (isIndefiniteRowsFunc(pNode)) {
|
||||
if (isAggFunc(pNode) || isIndefiniteRowsFunc(pNode) || isWindowPseudoColumnFunc(pNode)) {
|
||||
*((bool*)pContext) = true;
|
||||
return DEAL_RES_END;
|
||||
}
|
||||
|
|
|
@ -995,3 +995,22 @@ endi
|
|||
if $data00 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql create table ft1(ts timestamp, a int, b int , c int, d double);
|
||||
|
||||
sql insert into ft1 values(1648791213000,1,2,3,1.0);
|
||||
sql_error select sum(_wduration), a from ft1 state_window(a);
|
||||
|
||||
sql_error select count(_wduration), a from ft1 state_window(a);
|
||||
|
||||
sql_error select max(_wduration), a from ft1 state_window(a);
|
||||
|
||||
sql_error select sum(1 + _wduration), a from ft1 state_window(a);
|
||||
|
||||
sql_error select sum(cast(_wstart as bigint)), a from ft1 state_window(a);
|
||||
|
||||
sql_error select sum(cast(_wend as bigint)), a from ft1 state_window(a);
|
||||
|
||||
sql_error create stream streams1 trigger at_once into streamt as select _wstart, sum(_wduration) from ft1 interval(10s);
|
||||
|
||||
sql_error create stream streams1 trigger at_once into streamt as select _wstart, sum(cast(_wend as bigint)) from ft1 interval(10s);
|
Loading…
Reference in New Issue