add check
This commit is contained in:
parent
6f2a78a4bb
commit
1ce2109fa4
|
@ -10385,9 +10385,20 @@ static int32_t checkStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStm
|
|||
}
|
||||
|
||||
if (pSelect->hasInterpFunc) {
|
||||
if (pStmt->pOptions->fillHistory && pStmt->pOptions->triggerType == STREAM_TRIGGER_FORCE_WINDOW_CLOSE) {
|
||||
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY,
|
||||
"When trigger was force window close, Stream interp unsupported Fill history");
|
||||
if (pStmt->pOptions->triggerType == STREAM_TRIGGER_FORCE_WINDOW_CLOSE) {
|
||||
if (pStmt->pOptions->fillHistory) {
|
||||
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY,
|
||||
"When trigger was force window close, Stream interp unsupported Fill history");
|
||||
} else if (pSelect->pFill != NULL) {
|
||||
EFillMode mode = ((SFillNode*)(pSelect->pFill))->mode;
|
||||
if (mode == FILL_MODE_NEXT) {
|
||||
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY,
|
||||
"When trigger was force window close, Stream interp unsupported Fill(Next)");
|
||||
} else if (mode == FILL_MODE_LINEAR) {
|
||||
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY,
|
||||
"When trigger was force window close, Stream interp unsupported Fill(Linear)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pStmt->pOptions->triggerType == STREAM_TRIGGER_WINDOW_CLOSE) {
|
||||
|
|
|
@ -75,6 +75,26 @@ sql_error create stream streams2_6_8 trigger force_window_close FILL_HISTORY 1 I
|
|||
sql_error create stream streams2_6_9 trigger force_window_close FILL_HISTORY 1 IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt2_6_9 as select interp(a), _isfilled as a1, interp(b), _isfilled as a2, interp(c), _isfilled as a3, interp(d) from t1 every(1s) fill(NULL);
|
||||
sql_error create stream streams2_6_10 trigger force_window_close FILL_HISTORY 1 IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt2_6_10 as select interp(a), _isfilled as a1, interp(b), _isfilled as a2, interp(c), _isfilled as a3, interp(d) from t1 every(1s) fill(value,11,22,33,44);
|
||||
|
||||
|
||||
|
||||
print step3
|
||||
|
||||
sql create database test3 vgroups 1;
|
||||
sql use test3;
|
||||
|
||||
sql create stable st(ts timestamp,a int,b int,c int, d double) tags(ta int,tb int,tc int);
|
||||
sql create table t1 using st tags(1,1,1);
|
||||
sql create table t2 using st tags(2,2,2);
|
||||
|
||||
print step3_0
|
||||
|
||||
sql create stream streams3_0_1 trigger at_once FILL_HISTORY 1 IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt3_0_1 as select interp(a), _isfilled as a1, interp(b), _isfilled as a2, interp(c), _isfilled as a3, interp(d) from t1 every(1s) fill(prev);
|
||||
sql_error create stream streams3_0_2 trigger at_once FILL_HISTORY 1 IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt3_0_2 as select interp(a), _isfilled as a1, interp(b), _isfilled as a2, interp(c), _isfilled as a3, interp(d) from t1 every(1s) fill(next);
|
||||
sql_error create stream streams3_0_3 trigger at_once FILL_HISTORY 1 IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt3_0_3 as select interp(a), _isfilled as a1, interp(b), _isfilled as a2, interp(c), _isfilled as a3, interp(d) from t1 every(1s) fill(linear);
|
||||
sql create stream streams3_0_4 trigger at_once FILL_HISTORY 1 IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt3_0_4 as select interp(a), _isfilled as a1, interp(b), _isfilled as a2, interp(c), _isfilled as a3, interp(d) from t1 every(1s) fill(NULL);
|
||||
sql create stream streams3_0_5 trigger at_once FILL_HISTORY 1 IGNORE EXPIRED 0 IGNORE UPDATE 0 into streamt3_0_5 as select interp(a), _isfilled as a1, interp(b), _isfilled as a2, interp(c), _isfilled as a3, interp(d) from t1 every(1s) fill(value,11,22,33,44);
|
||||
|
||||
|
||||
run tsim/stream/checkTaskStatus.sim
|
||||
|
||||
run tsim/stream/checkTaskStatus.sim
|
||||
|
|
Loading…
Reference in New Issue