From 1c0d20a2a4cc1977d01b0875f75653d6dda17e51 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 20 Mar 2024 15:45:24 +0800 Subject: [PATCH] enh: add test cases --- source/libs/executor/test/joinTests.cpp | 10 +- source/libs/parser/src/parTranslater.c | 38 ++++ source/libs/parser/src/parUtil.c | 2 +- source/libs/planner/src/planOptimizer.c | 13 ++ tests/script/tsim/join/join.sim | 10 +- tests/script/tsim/join/join_boundary.sim | 259 +++++++++++++++++++++++ 6 files changed, 322 insertions(+), 10 deletions(-) create mode 100644 tests/script/tsim/join/join_boundary.sim diff --git a/source/libs/executor/test/joinTests.cpp b/source/libs/executor/test/joinTests.cpp index abb95b3f66..5d5c5e9395 100755 --- a/source/libs/executor/test/joinTests.cpp +++ b/source/libs/executor/test/joinTests.cpp @@ -66,7 +66,7 @@ enum { }; #define COL_DISPLAY_WIDTH 18 -#define JT_MAX_LOOP 10000 +#define JT_MAX_LOOP 1000000 #define LEFT_BLK_ID 0 #define RIGHT_BLK_ID 1 @@ -2858,7 +2858,7 @@ void runSingleTest(char* caseName, SJoinTestParam* param) { bool contLoop = true; SSortMergeJoinPhysiNode* pNode = createDummySortMergeJoinPhysiNode(param); - createDummyBlkList(10000, 1000, 10000, 1000, 100); + createDummyBlkList(10, 10, 10, 10, 3); while (contLoop) { rerunBlockedHere(); @@ -3335,7 +3335,7 @@ TEST(leftSemiJoin, fullCondTest) { #endif #endif -#if 1 +#if 0 #if 1 TEST(leftAntiJoin, noCondTest) { SJoinTestParam param; @@ -3446,7 +3446,7 @@ TEST(leftAntiJoin, fullCondTest) { #endif #endif -#if 1 +#if 0 #if 1 TEST(leftAsofJoin, noCondGreaterThanTest) { SJoinTestParam param; @@ -3606,7 +3606,7 @@ TEST(leftAsofJoin, noCondLowerEqTest) { #endif -#if 1 +#if 0 #if 1 TEST(leftWinJoin, noCondProjectionTest) { SJoinTestParam param; diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index aa8f532ad6..9ff0b2bb16 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -3509,6 +3509,36 @@ static int32_t checkJoinTable(STranslateContext* pCxt, SJoinTableNode* pJoinTabl "Unsupported ASOF/WINDOW join table type"); } + if (IS_WINDOW_JOIN(pJoinTable->subType)) { + if (pLeft->table.precision != pRight->table.precision) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_SUPPORT_JOIN, + "Same database precision required in WINDOW join"); + } + SWindowOffsetNode* pWinOffset = (SWindowOffsetNode*)pJoinTable->pWindowOffset; + SValueNode* pStart = (SValueNode*)pWinOffset->pStartOffset; + SValueNode* pEnd = (SValueNode*)pWinOffset->pEndOffset; + switch (pLeft->table.precision) { + case TSDB_TIME_PRECISION_MILLI: + if (TIME_UNIT_NANOSECOND == pStart->unit || TIME_UNIT_MICROSECOND == pStart->unit) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_WIN_OFFSET_UNIT, pStart->unit); + } + if (TIME_UNIT_NANOSECOND == pEnd->unit || TIME_UNIT_MICROSECOND == pEnd->unit) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_WIN_OFFSET_UNIT, pEnd->unit); + } + break; + case TSDB_TIME_PRECISION_MICRO: + if (TIME_UNIT_NANOSECOND == pStart->unit) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_WIN_OFFSET_UNIT, pStart->unit); + } + if (TIME_UNIT_NANOSECOND == pEnd->unit) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_WIN_OFFSET_UNIT, pEnd->unit); + } + break; + default: + break; + } + } + int32_t code = addPrimJoinEqCond(&pJoinTable->addPrimCond, pLeft, pRight, pJoinTable->joinType, pJoinTable->subType); if (TSDB_CODE_SUCCESS != code) { return code; @@ -4903,6 +4933,14 @@ static int32_t translateInterp(STranslateContext* pCxt, SSelectStmt* pSelect) { return TSDB_CODE_SUCCESS; } + if ((NULL != pSelect->pFromTable) && (QUERY_NODE_JOIN_TABLE == nodeType(pSelect->pFromTable))) { + SJoinTableNode* pJoinTable = (SJoinTableNode*)pSelect->pFromTable; + if (IS_WINDOW_JOIN(pJoinTable->subType)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_INTERP_CLAUSE, + "Interp not supported to be used in WINDOW join"); + } + } + if (NULL == pSelect->pRange || NULL == pSelect->pEvery || NULL == pSelect->pFill) { if (pSelect->pRange != NULL && QUERY_NODE_OPERATOR == nodeType(pSelect->pRange) && pSelect->pEvery == NULL) { // single point interp every can be omitted diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 5ea3049968..de09a78752 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -197,7 +197,7 @@ static char* getSyntaxErrFormat(int32_t errCode) { case TSDB_CODE_PAR_INVALID_WJOIN_HAVING_EXPR: return "Not supported window join having expr"; case TSDB_CODE_PAR_INVALID_WIN_OFFSET_UNIT: - return "Invalid WINDOW_OFFSET unit \"%s\""; + return "Invalid WINDOW_OFFSET unit \"%c\""; case TSDB_CODE_PAR_VALID_PRIM_TS_REQUIRED: return "Valid primary timestamp required"; default: diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 1145eaf0bf..559fab5590 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -614,6 +614,9 @@ static int32_t pdcJoinSplitLogicCond(SJoinLogicNode* pJoin, SNode** pSrcCond, SN SNode** pRightChildCond, bool whereCond) { SLogicConditionNode* pLogicCond = (SLogicConditionNode*)*pSrcCond; if (LOGIC_COND_TYPE_AND != pLogicCond->condType) { + if (whereCond) { + return TSDB_CODE_SUCCESS; + } return TSDB_CODE_PLAN_NOT_SUPPORT_JOIN_COND; } @@ -1229,6 +1232,16 @@ static int32_t pdcJoinCheckAllCond(SOptimizeContext* pCxt, SJoinLogicNode* pJoin if (errCond) { return generateUsageErrMsg(pCxt->pPlanCxt->pMsg, pCxt->pPlanCxt->msgLen, TSDB_CODE_PLAN_NOT_SUPPORT_JOIN_COND); } + + if (IS_INNER_NONE_JOIN(pJoin->joinType, pJoin->subType) && NULL != pJoin->pFullOnCond && NULL != pJoin->node.pConditions) { + if (pdcJoinHasPrimEqualCond(pJoin, pJoin->node.pConditions, &errCond)) { + return TSDB_CODE_SUCCESS; + } + if (errCond) { + return generateUsageErrMsg(pCxt->pPlanCxt->pMsg, pCxt->pPlanCxt->msgLen, TSDB_CODE_PLAN_NOT_SUPPORT_JOIN_COND); + } + } + if (IS_WINDOW_JOIN(pJoin->subType) || IS_ASOF_JOIN(pJoin->subType)) { return TSDB_CODE_SUCCESS; } diff --git a/tests/script/tsim/join/join.sim b/tests/script/tsim/join/join.sim index f2b0039bb0..ebb475ef2f 100644 --- a/tests/script/tsim/join/join.sim +++ b/tests/script/tsim/join/join.sim @@ -2,7 +2,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start sql connect -sql drop database if exists test0 +sql drop database if exists test0; sql create database test0 vgroups 3; sql use test0; sql create stable sta (ts timestamp, col1 int) tags(t1 int); @@ -19,7 +19,7 @@ sql insert into tba2 values ('2023-11-17 16:29:01', 3); sql insert into tba2 values ('2023-11-17 16:29:03', 5); sql insert into tba2 values ('2023-11-17 16:29:05', 7); -sql drop database if exists testa +sql drop database if exists testa; sql create database testa vgroups 3; sql use testa; @@ -41,8 +41,8 @@ sql create table tt using stt tags(99); sql create table stv(ts timestamp, h int) tags (t1 int); sql insert into ctv1 using stv tags(1) values('2023-10-16 10:10:10', 1); -sql drop database if exists testb -sql create database testb vgroups 1; +sql drop database if exists testb; +sql create database testb vgroups 1 PRECISION 'us'; sql use testb; sql create table stb1(ts timestamp, f int,g int) tags (t int); @@ -72,6 +72,7 @@ run tsim/join/right_win_join.sim run tsim/join/join_scalar.sim run tsim/join/join_timeline.sim run tsim/join/join_nested.sim +run tsim/join/join_boundary.sim print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT @@ -93,5 +94,6 @@ run tsim/join/right_win_join.sim run tsim/join/join_scalar.sim run tsim/join/join_timeline.sim run tsim/join/join_nested.sim +run tsim/join/join_boundary.sim system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/join/join_boundary.sim b/tests/script/tsim/join/join_boundary.sim new file mode 100644 index 0000000000..174ecb75c2 --- /dev/null +++ b/tests/script/tsim/join/join_boundary.sim @@ -0,0 +1,259 @@ +sql connect +sql use test0; + +#join type +sql_error select a.ts from sta a outer join sta b on b.ts = b.ts; +sql_error select a.ts from sta a semi join sta b on b.ts = b.ts; +sql_error select a.ts from sta a anti join sta b on b.ts = b.ts; +sql_error select a.ts from sta a asof join sta b on b.ts = b.ts; +sql_error select a.ts from sta a window join sta b window_offset(-1s, 1s); +sql_error select a.ts from sta a inner outer join sta b on b.ts = b.ts; +sql_error select a.ts from sta a inner semi join sta b on b.ts = b.ts; +sql_error select a.ts from sta a inner anti join sta b on b.ts = b.ts; +sql_error select a.ts from sta a inner asof join sta b on b.ts = b.ts; +sql_error select a.ts from sta a inner window join sta b on b.ts = b.ts; +sql_error select a.ts from sta a left inner join sta b on b.ts = b.ts; +sql_error select a.ts from sta a right inner join sta b on b.ts = b.ts; +sql_error select a.ts from sta a full inner join sta b on b.ts = b.ts; +sql_error select a.ts from sta a full semi join sta b on b.ts = b.ts; +sql_error select a.ts from sta a full anti join sta b on b.ts = b.ts; +sql_error select a.ts from sta a full asof join sta b on b.ts = b.ts; +sql_error select a.ts from sta a full window join sta b window_offset(-1s, 1s); + +#inner join +sql_error select a.ts from sta a join sta b; +sql_error select a.ts from sta a join sta b on a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a join sta b where a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a join sta b on a.col1 = b.col1; +sql_error select a.ts from sta a join sta b on a.col1 is null; +sql_error select a.ts from sta a join sta b on a.ts + 1 = b.col1; +sql_error select a.ts from sta a join sta b on timetruncate(a.ts, 1d) > b.ts; +sql_error select a.ts from sta a join sta b on timetruncate(a.ts, 1d) = b.ts + 1; +sql select a.ts from sta a join sta b on a.ts = b.ts; +sql select a.ts from sta a join sta b on timetruncate(a.ts, 1d) = b.ts; +sql select a.ts from sta a join sta b on timetruncate(a.ts, 1d) = timetruncate(b.ts, 1w); +sql_error select a.ts from sta a join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 1; +sql_error select a.ts from sta a join sta b on timetruncate(a.ts, 1d) = b.ts window_offset(-1s, 1s); +sql_error select a.ts from sta a join sta b on a.col1 = b.col1 where a.col1=b.col1; +sql select a.ts from sta a join sta b on a.col1 = b.col1 where a.ts=b.ts; +sql select a.ts from sta a join sta b where a.ts=b.ts; +sql_error select a.ts from sta a ,sta b on a.ts=b.ts; +sql select a.ts from sta a ,sta b where a.ts=b.ts; +sql select a.ts from sta a ,sta b where a.ts=b.ts and a.col1 + 1 = b.col1; +sql select b.col1 from sta a ,sta b where a.ts=b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql select b.col1 from sta a join sta b join sta c where a.ts=b.ts and b.ts = c.ts order by a.ts; +sql select b.col1 from (select ts from sta) a join (select ts, col1 from sta) b join sta c where a.ts=b.ts and b.ts = c.ts order by a.ts; +sql_error select b.col1 from sta a join sta b join sta c where a.ts=b.ts and a.ts = b.ts order by a.ts; +sql select a.ts from test0.sta a ,testb.stb1 b where a.ts=b.ts; + +#left join +sql_error select a.ts from sta a left join sta b; +sql_error select a.ts from sta a left join sta b on a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left join sta b where a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left join sta b on a.col1 = b.col1; +sql_error select a.ts from sta a left join sta b on a.col1 is not NULL; +sql_error select a.ts from sta a left join sta b on a.ts + 1 = b.col1; +sql_error select a.ts from sta a left join sta b on timetruncate(a.ts, 1d) > b.ts; +sql_error select a.ts from sta a left join sta b on timetruncate(a.ts, 1d) = b.ts + 1; +sql_error select a.ts from sta a left join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 1; +sql_error select a.ts from sta a left join sta b on timetruncate(a.ts, 1d) = b.ts window_offset(-1s, 1s); +sql select a.ts from sta a left join sta b on timetruncate(a.ts, 1d) = b.ts; +sql_error select a.ts from sta a left join sta b on a.col1 = b.col1 where a.col1 = b.col1; +sql_error select a.ts from sta a left join sta b on a.col1 = b.col1 where a.ts = b.ts; +sql_error select a.ts from sta a left join sta b where a.ts = b.ts; +sql_error select b.col1 from sta a left join sta b where a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql select b.col1 from sta a left join sta b on a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql select b.col1 from (select ts from sta) a left join (select ts, col1 from sta) b on a.ts = b.ts order by a.ts; +sql_error select b.col1 from (select ts from sta) a left join (select ts, col1 from sta) b left join sta c on a.ts=b.ts and b.ts = c.ts order by a.ts; +sql_error select b.col1 from sta a left join sta b left join sta c on a.ts=b.ts and a.ts = b.ts order by a.ts; +sql select a.ts from test0.sta a left join testb.stb1 b on a.ts = b.ts; + +#left semi join +sql_error select a.ts from sta a left semi join sta b; +sql_error select a.ts from sta a left semi join sta b on a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left semi join sta b where a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left semi join sta b on a.col1 = b.col1; +sql_error select a.ts from sta a left semi join sta b on a.col1 like '1'; +sql_error select a.ts from sta a left semi join sta b on a.col1 is null; +sql_error select a.ts from sta a left semi join sta b on a.ts + 1 = b.col1; +sql_error select a.ts from sta a left semi join sta b on timetruncate(a.ts, 1d) > b.ts; +sql_error select a.ts from sta a left semi join sta b on timetruncate(a.ts, 1d) = b.ts + 1; +sql_error select a.ts from sta a left semi join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 1; +sql_error select a.ts from sta a left semi join sta b on timetruncate(a.ts, 1d) = b.ts window_offset(-1s, 1s); +sql select a.ts from sta a left semi join sta b on timetruncate(a.ts, 1d) = b.ts; +sql_error select a.ts from sta a left semi join sta b on a.col1 = b.col1 where a.col1 = b.col1; +sql_error select a.ts from sta a left semi join sta b on a.col1 = b.col1 where a.ts = b.ts; +sql_error select a.ts from sta a left semi join sta b where a.ts = b.ts; +sql_error select b.col1 from sta a left semi join sta b where a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql select b.col1 from sta a left semi join sta b on a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql select b.col1 from (select ts from sta) a left semi join (select ts, col1 from sta) b on a.ts=b.ts order by a.ts; +sql_error select b.col1 from (select ts from sta) a left semi join (select ts, col1 from sta) b left semi join sta c on a.ts=b.ts and b.ts = c.ts order by a.ts; +sql_error select b.col1 from sta a left semi join sta b left semi join sta c on a.ts=b.ts and a.ts = b.ts order by a.ts; +sql select a.ts from test0.sta a left semi join testb.stb1 b on a.ts = b.ts; + +#left anti join +sql_error select a.ts from sta a left anti join sta b; +sql_error select a.ts from sta a left anti join sta b on a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left anti join sta b where a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left anti join sta b on a.col1 = b.col1; +sql_error select a.ts from sta a left anti join sta b on a.col1 / 1; +sql_error select a.ts from sta a left anti join sta b on a.col1 is null; +sql_error select a.ts from sta a left anti join sta b on a.ts + 1 = b.col1; +sql_error select a.ts from sta a left anti join sta b on timetruncate(a.ts, 1d) > b.ts; +sql_error select a.ts from sta a left anti join sta b on timetruncate(a.ts, 1d) = b.ts + 1; +sql_error select a.ts from sta a left anti join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 1; +sql_error select a.ts from sta a left anti join sta b on timetruncate(a.ts, 1d) = b.ts window_offset(-1s, 1s); +sql select a.ts from sta a left anti join sta b on timetruncate(a.ts, 1d) = b.ts; +sql_error select a.ts from sta a left anti join sta b on a.col1 = b.col1 where a.col1 = b.col1; +sql_error select a.ts from sta a left anti join sta b on a.col1 = b.col1 where a.ts = b.ts; +sql_error select a.ts from sta a left anti join sta b where a.ts = b.ts; +sql_error select b.col1 from sta a left anti join sta b where a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql select b.col1 from sta a left anti join sta b on a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql select b.col1 from (select ts from sta) a left anti join (select ts, col1 from sta) b on a.ts=b.ts order by a.ts; +sql_error select b.col1 from (select ts from sta) a left anti join (select ts, col1 from sta) b left anti join sta c on a.ts=b.ts and b.ts = c.ts order by a.ts; +sql_error select b.col1 from sta a left anti join sta b left anti join sta c on a.ts=b.ts and a.ts = b.ts order by a.ts; +sql select a.ts from test0.sta a left anti join testb.stb1 b on a.ts = b.ts; + +#left asof join +sql select a.ts from sta a left asof join sta b; +sql_error select a.ts from sta a left asof join sta b on a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left asof join sta b on a.ts = b.ts and a.ts = b.ts; +sql_error select a.ts from sta a left asof join sta b on a.ts = b.ts or a.col1 = b.col1; +sql select a.ts from sta a left asof join sta b on a.ts = b.ts and a.col1 = b.col1; +sql select a.ts from sta a left asof join sta b on a.col1 = b.col1 and a.ts = b.ts; +sql select a.ts from sta a left asof join sta b where a.ts = b.ts; +sql select a.ts from sta a left asof join sta b where a.ts = b.ts or a.ts = b.ts; +sql select a.ts from sta a left asof join sta b on a.col1 = b.col1; +sql_error select a.ts from sta a left asof join sta b on a.ts != b.ts; +sql_error select a.ts from sta a left asof join sta b on a.ts is null; +sql_error select a.ts from sta a left asof join sta b on a.ts + 1 = b.col1; +sql select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) > b.ts; +sql_error select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) = b.ts + 1; +sql select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 1; +sql select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 0; +sql select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 1024; +sql_error select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 1025; +sql_error select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) = b.ts jlimit -1; +sql_error select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) = b.ts window_offset(-1s, 1s); +sql select a.ts from sta a left asof join sta b on timetruncate(a.ts, 1d) = b.ts; +sql select a.ts from sta a left asof join sta b on a.col1 = b.col1 where a.col1 = b.col1; +sql select a.ts from sta a left asof join sta b on a.col1 = b.col1 where a.ts = b.ts; +sql select a.ts from sta a left asof join sta b where a.ts = b.ts; +sql select b.col1 from sta a left asof join sta b where a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql_error select b.col1 from sta a left asof join sta b on a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql_error select b.col1 from sta a left asof join sta b on a.ts = b.ts and 1 = 2 order by a.ts; +sql_error select b.col1 from (select ts from sta) a left asof join (select ts, col1 from sta) b on a.ts=b.ts order by a.ts; +sql_error select b.col1 from (select ts from sta) a left asof join (select ts, col1 from sta) b left asof join sta c on a.ts=b.ts and b.ts = c.ts order by a.ts; +sql_error select b.col1 from sta a left asof join sta b left asof join sta c on a.ts=b.ts and a.ts = b.ts order by a.ts; +sql select a.ts from test0.sta a left asof join testb.stb1 b on a.ts = b.ts; + +#left window join +sql_error select a.ts from sta a left window join sta b; +sql_error select a.ts from sta a left window join sta b on a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left window join sta b on a.ts = b.ts and a.ts = b.ts; +sql_error select a.ts from sta a left window join sta b on a.ts = b.ts or a.col1 = b.col1; +sql_error select a.ts from sta a left window join sta b on a.ts = b.ts and a.col1 = b.col1; +sql_error select a.ts from sta a left window join sta b on a.ts = b.ts and a.col1 = b.col1 window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b on a.col1 = b.col1 and a.ts = b.ts; +sql_error select a.ts from sta a left window join sta b on a.col1 = b.col1 and a.ts = b.ts window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b where a.ts = b.ts; +sql select a.ts from sta a left window join sta b window_offset(-1s,1s) where a.ts = b.ts; +sql_error select a.ts from sta a left window join sta b where a.ts = b.ts or a.ts = b.ts; +sql select a.ts from sta a left window join sta b window_offset(-1s,1s) where a.ts = b.ts or a.ts = b.ts; +sql_error select a.ts from sta a left window join sta b on a.col1 = b.col1; +sql select a.ts from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s); +sql select a.ts from sta a left window join sta b on a.t1 = b.t1 window_offset(-1s,1s); +sql select a.ts from sta a left window join sta b on a.t1 = b.t1 and a.col1 = b.col1 window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b on a.t1 = b.t1 or a.col1 = b.col1 window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b on a.ts != b.ts; +sql_error select a.ts from sta a left window join sta b on a.ts != b.ts window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b on a.ts is null; +sql_error select a.ts from sta a left window join sta b on a.ts is null window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b on a.ts + 1 = b.col1; +sql_error select a.ts from sta a left window join sta b on a.ts + 1 = b.col1 window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b on timetruncate(a.ts, 1d) > b.ts; +sql_error select a.ts from sta a left window join sta b on timetruncate(a.ts, 1d) > b.ts window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b on timetruncate(a.ts, 1d) = b.ts + 1; +sql_error select a.ts from sta a left window join sta b on timetruncate(a.ts, 1d) = b.ts + 1 window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b on timetruncate(a.ts, 1d) = b.ts jlimit 1; +sql select a.ts from sta a left window join sta b window_offset(-1s,1s) jlimit 1; +sql select a.ts from sta a left window join sta b window_offset(-1s,1s) jlimit 0; +sql select a.ts from sta a left window join sta b window_offset(-1s,1s) jlimit 1024; +sql_error select a.ts from sta a left window join sta b window_offset(-1s,1s) jlimit 1025; +sql_error select a.ts from sta a left window join sta b window_offset(-1s,1s) jlimit -1; +sql select a.ts from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s, 1s) jlimit 1; +sql_error select a.ts from sta a left window join sta b on timetruncate(a.ts, 1d) = b.ts; +sql_error select a.ts from sta a left window join sta b on a.col1 = b.col1 where a.col1 = b.col1; +sql select a.ts from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where a.col1 = b.col1; +sql select a.ts from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where a.ts = b.ts; +sql_error select a.ts from sta a left window join sta b where a.ts = b.ts; +sql_error select b.col1 from sta a left window join sta b where a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql select b.col1 from sta a left window join sta b window_offset(-1s,1s) where a.ts = b.ts and a.col1 + 1 = b.col1 order by a.ts; +sql_error select b.col1 from sta a left window join sta b on a.ts = b.ts window_offset(-1s,1s) order by a.ts; +sql_error select b.col1 from sta a left window join sta b on a.ts = b.ts and a.col1 + 1 = b.col1 window_offset(-1s,1s) order by a.ts; +sql_error select b.col1 from sta a left window join sta b on a.ts = b.ts and 1 = 2 window_offset(-1s,1s) order by a.ts; +sql_error select b.col1 from (select ts from sta) a left window join (select ts, col1 from sta) b window_offset(-1s,1s) order by a.ts; +sql_error select b.col1 from (select ts from sta) a left window join (select ts, col1 from sta) b left window join sta c window_offset(-1s,1s) order by a.ts; +sql_error select b.col1 from sta a left window join sta b left window join sta c window_offset(-1s,1s) order by a.ts; +sql_error select a.ts from test0.sta a left window join testb.stb1 b window_offset(-1s,1s); +sql select a.ts from testb.stb1 a left window join testb.stb1 b window_offset(-1s,1s); +sql_error select a.ts from sta a left window join sta b window_offset(1s,-1s) jlimit a.col1; +sql_error select a.ts from sta a left window join sta b window_offset(1s,-1s) jlimit 1 + 1; +sql_error select a.ts from sta a left window join sta b window_offset(1s,1s-1s) jlimit 1; +sql select a.ts from sta a left window join sta b window_offset(1s,-1s) jlimit 1; +sql select a.ts from sta a left window join sta b window_offset(-1a,1a) jlimit 1; +sql_error select a.ts from sta a left window join sta b window_offset(-1b,1b) jlimit 1; +sql_error select a.ts from sta a left window join sta b window_offset(-1b,1s) jlimit 1; +sql_error select a.ts from sta a left window join sta b window_offset(-1u,1u) jlimit 1; +sql_error select a.ts from sta a left window join sta b window_offset(-1u,1s) jlimit 1; +sql select a.ts from sta a left window join sta b window_offset(-1h,1m) jlimit 1; +sql select a.ts from sta a left window join sta b window_offset(-1d,1w) jlimit 1; +sql_error select a.ts from sta a left window join sta b window_offset(-1n,1n) jlimit 1; +sql_error select a.ts from sta a left window join sta b window_offset(-1y,1y) jlimit 1; +sql connect; +sql use testb; +sql_error select a.ts from stb1 a left window join stb1 b window_offset(-1b,1b) jlimit 1; +sql_error select a.ts from stb1 a left window join stb1 b window_offset(-1b,1s) jlimit 1; +sql select a.ts from stb1 a left window join stb1 b window_offset(-1u,1u) jlimit 1; +sql select a.ts from stb1 a left window join stb1 b window_offset(-1s,1s) jlimit 1; +sql connect; +sql use test0; +sql_error select a.col1 from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where a.col1 = b.col1 group by a.col1; +sql_error select a.col1 from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where a.col1 = b.col1 partition by a.col1; +sql_error select count(a.col1) from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where a.col1 = b.col1 interval(1s); +sql_error select count(a.col1) from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where a.col1 = b.col1 session(a.ts, 1s); +sql_error select count(a.col1) from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where a.col1 = b.col1 state_window(a.col1); +sql select count(a.col1) from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) having(count(a.col1) > 0); +sql_error select count(a.col1) from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) having(a.col1 > 0); +sql select a.col1, b.col1, count(a.col1) from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where a.col1 > 0; +sql_error select a.col1, b.col1, count(a.col1) from sta a left window join sta b window_offset(-1s,1s) where a.col1 > 0; +sql_error select diff(a.col1) from sta a left window join sta b window_offset(-1s,1s); +sql_error select csum(a.col1) from sta a left window join sta b window_offset(-1s,1s); +sql select diff(a.col1) from tba1 a left window join tba1 b window_offset(0s,0s); +sql select csum(a.col1) from tba1 a left window join tba1 b window_offset(0s,0s); +sql_error select interp(a.col1) from tba1 a left window join tba1 b window_offset(0s,0s) RANGE(now -1d, now) every(1s) fill(null); +sql_error select a.col1, b.col1, count(a.col1) from sta a left window join sta b on a.col1 = b.col1 window_offset(-1s,1s) where count(a.col1) > 0; + + + + + + + + + + + + + + + + + + + + + + + +