Merge pull request #19817 from taosdata/feat/TS-2502
feat: support force fill in interval clause
This commit is contained in:
commit
19508d118f
|
@ -146,10 +146,12 @@ typedef enum _mgmt_table {
|
||||||
|
|
||||||
#define TSDB_FILL_NONE 0
|
#define TSDB_FILL_NONE 0
|
||||||
#define TSDB_FILL_NULL 1
|
#define TSDB_FILL_NULL 1
|
||||||
#define TSDB_FILL_SET_VALUE 2
|
#define TSDB_FILL_NULL_F 2
|
||||||
#define TSDB_FILL_LINEAR 3
|
#define TSDB_FILL_SET_VALUE 3
|
||||||
#define TSDB_FILL_PREV 4
|
#define TSDB_FILL_SET_VALUE_F 4
|
||||||
#define TSDB_FILL_NEXT 5
|
#define TSDB_FILL_LINEAR 5
|
||||||
|
#define TSDB_FILL_PREV 6
|
||||||
|
#define TSDB_FILL_NEXT 7
|
||||||
|
|
||||||
#define TSDB_ALTER_USER_PASSWD 0x1
|
#define TSDB_ALTER_USER_PASSWD 0x1
|
||||||
#define TSDB_ALTER_USER_SUPERUSER 0x2
|
#define TSDB_ALTER_USER_SUPERUSER 0x2
|
||||||
|
|
|
@ -269,74 +269,77 @@
|
||||||
#define TK_SLIDING 251
|
#define TK_SLIDING 251
|
||||||
#define TK_FILL 252
|
#define TK_FILL 252
|
||||||
#define TK_VALUE 253
|
#define TK_VALUE 253
|
||||||
#define TK_NONE 254
|
#define TK_VALUE_F 254
|
||||||
#define TK_PREV 255
|
#define TK_NONE 255
|
||||||
#define TK_LINEAR 256
|
#define TK_PREV 256
|
||||||
#define TK_NEXT 257
|
#define TK_NULL_F 257
|
||||||
#define TK_HAVING 258
|
#define TK_LINEAR 258
|
||||||
#define TK_RANGE 259
|
#define TK_NEXT 259
|
||||||
#define TK_EVERY 260
|
#define TK_HAVING 260
|
||||||
#define TK_ORDER 261
|
#define TK_RANGE 261
|
||||||
#define TK_SLIMIT 262
|
#define TK_EVERY 262
|
||||||
#define TK_SOFFSET 263
|
#define TK_ORDER 263
|
||||||
#define TK_LIMIT 264
|
#define TK_SLIMIT 264
|
||||||
#define TK_OFFSET 265
|
#define TK_SOFFSET 265
|
||||||
#define TK_ASC 266
|
#define TK_LIMIT 266
|
||||||
#define TK_NULLS 267
|
#define TK_OFFSET 267
|
||||||
#define TK_ABORT 268
|
#define TK_ASC 268
|
||||||
#define TK_AFTER 269
|
#define TK_NULLS 269
|
||||||
#define TK_ATTACH 270
|
#define TK_ABORT 270
|
||||||
#define TK_BEFORE 271
|
#define TK_AFTER 271
|
||||||
#define TK_BEGIN 272
|
#define TK_ATTACH 272
|
||||||
#define TK_BITAND 273
|
#define TK_BEFORE 273
|
||||||
#define TK_BITNOT 274
|
#define TK_BEGIN 274
|
||||||
#define TK_BITOR 275
|
#define TK_BITAND 275
|
||||||
#define TK_BLOCKS 276
|
#define TK_BITNOT 276
|
||||||
#define TK_CHANGE 277
|
#define TK_BITOR 277
|
||||||
#define TK_COMMA 278
|
#define TK_BLOCKS 278
|
||||||
#define TK_COMPACT 279
|
#define TK_CHANGE 279
|
||||||
#define TK_CONCAT 280
|
#define TK_COMMA 280
|
||||||
#define TK_CONFLICT 281
|
#define TK_COMPACT 281
|
||||||
#define TK_COPY 282
|
#define TK_CONCAT 282
|
||||||
#define TK_DEFERRED 283
|
#define TK_CONFLICT 283
|
||||||
#define TK_DELIMITERS 284
|
#define TK_COPY 284
|
||||||
#define TK_DETACH 285
|
#define TK_DEFERRED 285
|
||||||
#define TK_DIVIDE 286
|
#define TK_DELIMITERS 286
|
||||||
#define TK_DOT 287
|
#define TK_DETACH 287
|
||||||
#define TK_EACH 288
|
#define TK_DIVIDE 288
|
||||||
#define TK_FAIL 289
|
#define TK_DOT 289
|
||||||
#define TK_FILE 290
|
#define TK_EACH 290
|
||||||
#define TK_FOR 291
|
#define TK_FAIL 291
|
||||||
#define TK_GLOB 292
|
#define TK_FILE 292
|
||||||
#define TK_ID 293
|
#define TK_FOR 293
|
||||||
#define TK_IMMEDIATE 294
|
#define TK_GLOB 294
|
||||||
#define TK_IMPORT 295
|
#define TK_ID 295
|
||||||
#define TK_INITIALLY 296
|
#define TK_IMMEDIATE 296
|
||||||
#define TK_INSTEAD 297
|
#define TK_IMPORT 297
|
||||||
#define TK_ISNULL 298
|
#define TK_INITIALLY 298
|
||||||
#define TK_KEY 299
|
#define TK_INSTEAD 299
|
||||||
#define TK_MODULES 300
|
#define TK_ISNULL 300
|
||||||
#define TK_NK_BITNOT 301
|
#define TK_KEY 301
|
||||||
#define TK_NK_SEMI 302
|
#define TK_MODULES 302
|
||||||
#define TK_NOTNULL 303
|
#define TK_NK_BITNOT 303
|
||||||
#define TK_OF 304
|
#define TK_NK_SEMI 304
|
||||||
#define TK_PLUS 305
|
#define TK_NOTNULL 305
|
||||||
#define TK_PRIVILEGE 306
|
#define TK_OF 306
|
||||||
#define TK_RAISE 307
|
#define TK_PLUS 307
|
||||||
#define TK_REPLACE 308
|
#define TK_PRIVILEGE 308
|
||||||
#define TK_RESTRICT 309
|
#define TK_RAISE 309
|
||||||
#define TK_ROW 310
|
#define TK_REPLACE 310
|
||||||
#define TK_SEMI 311
|
#define TK_RESTRICT 311
|
||||||
#define TK_STAR 312
|
#define TK_ROW 312
|
||||||
#define TK_STATEMENT 313
|
#define TK_SEMI 313
|
||||||
#define TK_STRICT 314
|
#define TK_STAR 314
|
||||||
#define TK_STRING 315
|
#define TK_STATEMENT 315
|
||||||
#define TK_TIMES 316
|
#define TK_STRICT 316
|
||||||
#define TK_UPDATE 317
|
#define TK_STRING 317
|
||||||
#define TK_VALUES 318
|
#define TK_TIMES 318
|
||||||
#define TK_VARIABLE 319
|
#define TK_UPDATE 319
|
||||||
#define TK_VIEW 320
|
#define TK_VALUES 320
|
||||||
#define TK_WAL 321
|
#define TK_VARIABLE 321
|
||||||
|
#define TK_VIEW 322
|
||||||
|
#define TK_WAL 323
|
||||||
|
|
||||||
|
|
||||||
#define TK_NK_SPACE 600
|
#define TK_NK_SPACE 600
|
||||||
#define TK_NK_COMMENT 601
|
#define TK_NK_COMMENT 601
|
||||||
|
|
|
@ -226,8 +226,10 @@ typedef struct SIntervalWindowNode {
|
||||||
typedef enum EFillMode {
|
typedef enum EFillMode {
|
||||||
FILL_MODE_NONE = 1,
|
FILL_MODE_NONE = 1,
|
||||||
FILL_MODE_VALUE,
|
FILL_MODE_VALUE,
|
||||||
|
FILL_MODE_VALUE_F,
|
||||||
FILL_MODE_PREV,
|
FILL_MODE_PREV,
|
||||||
FILL_MODE_NULL,
|
FILL_MODE_NULL,
|
||||||
|
FILL_MODE_NULL_F,
|
||||||
FILL_MODE_LINEAR,
|
FILL_MODE_LINEAR,
|
||||||
FILL_MODE_NEXT
|
FILL_MODE_NEXT
|
||||||
} EFillMode;
|
} EFillMode;
|
||||||
|
|
|
@ -1658,12 +1658,18 @@ int32_t convertFillType(int32_t mode) {
|
||||||
case FILL_MODE_NULL:
|
case FILL_MODE_NULL:
|
||||||
type = TSDB_FILL_NULL;
|
type = TSDB_FILL_NULL;
|
||||||
break;
|
break;
|
||||||
|
case FILL_MODE_NULL_F:
|
||||||
|
type = TSDB_FILL_NULL_F;
|
||||||
|
break;
|
||||||
case FILL_MODE_NEXT:
|
case FILL_MODE_NEXT:
|
||||||
type = TSDB_FILL_NEXT;
|
type = TSDB_FILL_NEXT;
|
||||||
break;
|
break;
|
||||||
case FILL_MODE_VALUE:
|
case FILL_MODE_VALUE:
|
||||||
type = TSDB_FILL_SET_VALUE;
|
type = TSDB_FILL_SET_VALUE;
|
||||||
break;
|
break;
|
||||||
|
case FILL_MODE_VALUE_F:
|
||||||
|
type = TSDB_FILL_SET_VALUE_F;
|
||||||
|
break;
|
||||||
case FILL_MODE_LINEAR:
|
case FILL_MODE_LINEAR:
|
||||||
type = TSDB_FILL_LINEAR;
|
type = TSDB_FILL_LINEAR;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -140,7 +140,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) {
|
||||||
while (1) {
|
while (1) {
|
||||||
SSDataBlock* pBlock = pDownstream->fpSet.getNextFn(pDownstream);
|
SSDataBlock* pBlock = pDownstream->fpSet.getNextFn(pDownstream);
|
||||||
if (pBlock == NULL) {
|
if (pBlock == NULL) {
|
||||||
if (pInfo->totalInputRows == 0) {
|
if (pInfo->totalInputRows == 0 && (pInfo->pFillInfo->type != TSDB_FILL_NULL_F && pInfo->pFillInfo->type != TSDB_FILL_SET_VALUE_F)) {
|
||||||
setOperatorCompleted(pOperator);
|
setOperatorCompleted(pOperator);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,8 @@ void* destroyStreamFillLinearInfo(SStreamFillLinearInfo* pFillLinear) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
void* destroyStreamFillInfo(SStreamFillInfo* pFillInfo) {
|
void* destroyStreamFillInfo(SStreamFillInfo* pFillInfo) {
|
||||||
if (pFillInfo->type == TSDB_FILL_SET_VALUE || pFillInfo->type == TSDB_FILL_NULL) {
|
if (pFillInfo->type == TSDB_FILL_SET_VALUE || pFillInfo->type == TSDB_FILL_SET_VALUE_F ||
|
||||||
|
pFillInfo->type == TSDB_FILL_NULL || pFillInfo->type == TSDB_FILL_NULL_F) {
|
||||||
taosMemoryFreeClear(pFillInfo->pResRow->pRowVal);
|
taosMemoryFreeClear(pFillInfo->pResRow->pRowVal);
|
||||||
taosMemoryFreeClear(pFillInfo->pResRow);
|
taosMemoryFreeClear(pFillInfo->pResRow);
|
||||||
}
|
}
|
||||||
|
@ -661,7 +662,9 @@ void setDeleteFillValueInfo(TSKEY start, TSKEY end, SStreamFillSupporter* pFillS
|
||||||
pFillInfo->pos = FILL_POS_INVALID;
|
pFillInfo->pos = FILL_POS_INVALID;
|
||||||
switch (pFillInfo->type) {
|
switch (pFillInfo->type) {
|
||||||
case TSDB_FILL_NULL:
|
case TSDB_FILL_NULL:
|
||||||
|
case TSDB_FILL_NULL_F:
|
||||||
case TSDB_FILL_SET_VALUE:
|
case TSDB_FILL_SET_VALUE:
|
||||||
|
case TSDB_FILL_SET_VALUE_F:
|
||||||
break;
|
break;
|
||||||
case TSDB_FILL_PREV:
|
case TSDB_FILL_PREV:
|
||||||
pFillInfo->pResRow = &pFillSup->prev;
|
pFillInfo->pResRow = &pFillSup->prev;
|
||||||
|
@ -720,7 +723,9 @@ void setFillValueInfo(SSDataBlock* pBlock, TSKEY ts, int32_t rowId, SStreamFillS
|
||||||
pFillInfo->pos = FILL_POS_INVALID;
|
pFillInfo->pos = FILL_POS_INVALID;
|
||||||
switch (pFillInfo->type) {
|
switch (pFillInfo->type) {
|
||||||
case TSDB_FILL_NULL:
|
case TSDB_FILL_NULL:
|
||||||
case TSDB_FILL_SET_VALUE: {
|
case TSDB_FILL_NULL_F:
|
||||||
|
case TSDB_FILL_SET_VALUE:
|
||||||
|
case TSDB_FILL_SET_VALUE_F: {
|
||||||
if (pFillSup->prev.key == pFillInfo->preRowKey) {
|
if (pFillSup->prev.key == pFillInfo->preRowKey) {
|
||||||
resetFillWindow(&pFillSup->prev);
|
resetFillWindow(&pFillSup->prev);
|
||||||
}
|
}
|
||||||
|
@ -1360,7 +1365,8 @@ SStreamFillInfo* initStreamFillInfo(SStreamFillSupporter* pFillSup, SSDataBlock*
|
||||||
pFillInfo->pLinearInfo->winIndex = 0;
|
pFillInfo->pLinearInfo->winIndex = 0;
|
||||||
|
|
||||||
pFillInfo->pResRow = NULL;
|
pFillInfo->pResRow = NULL;
|
||||||
if (pFillSup->type == TSDB_FILL_SET_VALUE || pFillSup->type == TSDB_FILL_NULL) {
|
if (pFillSup->type == TSDB_FILL_SET_VALUE || pFillSup->type == TSDB_FILL_SET_VALUE_F
|
||||||
|
|| pFillSup->type == TSDB_FILL_NULL || pFillSup->type == TSDB_FILL_NULL_F) {
|
||||||
pFillInfo->pResRow = taosMemoryCalloc(1, sizeof(SResultRowData));
|
pFillInfo->pResRow = taosMemoryCalloc(1, sizeof(SResultRowData));
|
||||||
pFillInfo->pResRow->key = INT64_MIN;
|
pFillInfo->pResRow->key = INT64_MIN;
|
||||||
pFillInfo->pResRow->pRowVal = taosMemoryCalloc(1, pFillSup->rowSize);
|
pFillInfo->pResRow->pRowVal = taosMemoryCalloc(1, pFillSup->rowSize);
|
||||||
|
@ -1405,7 +1411,7 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pInfo->pFillInfo->type == TSDB_FILL_SET_VALUE) {
|
if (pInfo->pFillInfo->type == TSDB_FILL_SET_VALUE || pInfo->pFillInfo->type == TSDB_FILL_SET_VALUE_F) {
|
||||||
for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) {
|
for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) {
|
||||||
SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i;
|
SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i;
|
||||||
int32_t slotId = GET_DEST_SLOT_ID(pFillCol);
|
int32_t slotId = GET_DEST_SLOT_ID(pFillCol);
|
||||||
|
@ -1427,7 +1433,7 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi
|
||||||
pCell->isNull = true;
|
pCell->isNull = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (pInfo->pFillInfo->type == TSDB_FILL_NULL) {
|
} else if (pInfo->pFillInfo->type == TSDB_FILL_NULL || pInfo->pFillInfo->type == TSDB_FILL_NULL_F) {
|
||||||
for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) {
|
for (int32_t i = 0; i < pInfo->pFillSup->numOfAllCols; ++i) {
|
||||||
SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i;
|
SFillColInfo* pFillCol = pInfo->pFillSup->pAllColInfo + i;
|
||||||
int32_t slotId = GET_DEST_SLOT_ID(pFillCol);
|
int32_t slotId = GET_DEST_SLOT_ID(pFillCol);
|
||||||
|
|
|
@ -186,7 +186,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (pFillInfo->type == TSDB_FILL_NULL) { // fill with NULL
|
} else if (pFillInfo->type == TSDB_FILL_NULL || pFillInfo->type == TSDB_FILL_NULL_F) { // fill with NULL
|
||||||
setNullRow(pBlock, pFillInfo, index);
|
setNullRow(pBlock, pFillInfo, index);
|
||||||
} else { // fill with user specified value for each column
|
} else { // fill with user specified value for each column
|
||||||
for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
|
for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
|
||||||
|
@ -349,7 +349,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
|
||||||
bool isNull = colDataIsNull_s(pSrc, pFillInfo->index);
|
bool isNull = colDataIsNull_s(pSrc, pFillInfo->index);
|
||||||
colDataAppend(pDst, index, src, isNull);
|
colDataAppend(pDst, index, src, isNull);
|
||||||
saveColData(pFillInfo->prev.pRowVal, i, src, isNull); // todo:
|
saveColData(pFillInfo->prev.pRowVal, i, src, isNull); // todo:
|
||||||
} else if (pFillInfo->type == TSDB_FILL_NULL) {
|
} else if (pFillInfo->type == TSDB_FILL_NULL || pFillInfo->type == TSDB_FILL_NULL_F) {
|
||||||
colDataAppendNULL(pDst, index);
|
colDataAppendNULL(pDst, index);
|
||||||
} else if (pFillInfo->type == TSDB_FILL_NEXT) {
|
} else if (pFillInfo->type == TSDB_FILL_NEXT) {
|
||||||
SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->next.pRowVal : pFillInfo->prev.pRowVal;
|
SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->next.pRowVal : pFillInfo->prev.pRowVal;
|
||||||
|
@ -546,15 +546,14 @@ bool taosFillHasMoreResults(SFillInfo* pFillInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t maxNumOfRows) {
|
int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t maxNumOfRows) {
|
||||||
SColumnInfoData* pCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, pFillInfo->srcTsSlotId);
|
|
||||||
|
|
||||||
int64_t* tsList = (int64_t*)pCol->pData;
|
|
||||||
int32_t numOfRows = taosNumOfRemainRows(pFillInfo);
|
int32_t numOfRows = taosNumOfRemainRows(pFillInfo);
|
||||||
|
|
||||||
TSKEY ekey1 = ekey;
|
TSKEY ekey1 = ekey;
|
||||||
|
|
||||||
int64_t numOfRes = -1;
|
int64_t numOfRes = -1;
|
||||||
if (numOfRows > 0) { // still fill gap within current data block, not generating data after the result set.
|
if (numOfRows > 0) { // still fill gap within current data block, not generating data after the result set.
|
||||||
|
SColumnInfoData* pCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, pFillInfo->srcTsSlotId);
|
||||||
|
int64_t* tsList = (int64_t*)pCol->pData;
|
||||||
TSKEY lastKey = tsList[pFillInfo->numOfRows - 1];
|
TSKEY lastKey = tsList[pFillInfo->numOfRows - 1];
|
||||||
numOfRes = taosTimeCountInterval(lastKey, pFillInfo->currentKey, pFillInfo->interval.sliding,
|
numOfRes = taosTimeCountInterval(lastKey, pFillInfo->currentKey, pFillInfo->interval.sliding,
|
||||||
pFillInfo->interval.slidingUnit, pFillInfo->interval.precision);
|
pFillInfo->interval.slidingUnit, pFillInfo->interval.precision);
|
||||||
|
|
|
@ -181,12 +181,14 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
|
||||||
|
|
||||||
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId;
|
||||||
switch (pSliceInfo->fillType) {
|
switch (pSliceInfo->fillType) {
|
||||||
case TSDB_FILL_NULL: {
|
case TSDB_FILL_NULL:
|
||||||
|
case TSDB_FILL_NULL_F: {
|
||||||
colDataAppendNULL(pDst, rows);
|
colDataAppendNULL(pDst, rows);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case TSDB_FILL_SET_VALUE: {
|
case TSDB_FILL_SET_VALUE:
|
||||||
|
case TSDB_FILL_SET_VALUE_F: {
|
||||||
SVariant* pVar = &pSliceInfo->pFillColInfo[j].fillVal;
|
SVariant* pVar = &pSliceInfo->pFillColInfo[j].fillVal;
|
||||||
|
|
||||||
if (pDst->info.type == TSDB_DATA_TYPE_FLOAT) {
|
if (pDst->info.type == TSDB_DATA_TYPE_FLOAT) {
|
||||||
|
|
|
@ -1990,10 +1990,14 @@ char* nodesGetFillModeString(EFillMode mode) {
|
||||||
return "none";
|
return "none";
|
||||||
case FILL_MODE_VALUE:
|
case FILL_MODE_VALUE:
|
||||||
return "value";
|
return "value";
|
||||||
|
case FILL_MODE_VALUE_F:
|
||||||
|
return "value_f";
|
||||||
case FILL_MODE_PREV:
|
case FILL_MODE_PREV:
|
||||||
return "prev";
|
return "prev";
|
||||||
case FILL_MODE_NULL:
|
case FILL_MODE_NULL:
|
||||||
return "null";
|
return "null";
|
||||||
|
case FILL_MODE_NULL_F:
|
||||||
|
return "null_f";
|
||||||
case FILL_MODE_LINEAR:
|
case FILL_MODE_LINEAR:
|
||||||
return "linear";
|
return "linear";
|
||||||
case FILL_MODE_NEXT:
|
case FILL_MODE_NEXT:
|
||||||
|
|
|
@ -978,12 +978,14 @@ sliding_opt(A) ::= SLIDING NK_LP duration_literal(B) NK_RP.
|
||||||
fill_opt(A) ::= . { A = NULL; }
|
fill_opt(A) ::= . { A = NULL; }
|
||||||
fill_opt(A) ::= FILL NK_LP fill_mode(B) NK_RP. { A = createFillNode(pCxt, B, NULL); }
|
fill_opt(A) ::= FILL NK_LP fill_mode(B) NK_RP. { A = createFillNode(pCxt, B, NULL); }
|
||||||
fill_opt(A) ::= FILL NK_LP VALUE NK_COMMA literal_list(B) NK_RP. { A = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, B)); }
|
fill_opt(A) ::= FILL NK_LP VALUE NK_COMMA literal_list(B) NK_RP. { A = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, B)); }
|
||||||
|
fill_opt(A) ::= FILL NK_LP VALUE_F NK_COMMA literal_list(B) NK_RP. { A = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, B)); }
|
||||||
|
|
||||||
%type fill_mode { EFillMode }
|
%type fill_mode { EFillMode }
|
||||||
%destructor fill_mode { }
|
%destructor fill_mode { }
|
||||||
fill_mode(A) ::= NONE. { A = FILL_MODE_NONE; }
|
fill_mode(A) ::= NONE. { A = FILL_MODE_NONE; }
|
||||||
fill_mode(A) ::= PREV. { A = FILL_MODE_PREV; }
|
fill_mode(A) ::= PREV. { A = FILL_MODE_PREV; }
|
||||||
fill_mode(A) ::= NULL. { A = FILL_MODE_NULL; }
|
fill_mode(A) ::= NULL. { A = FILL_MODE_NULL; }
|
||||||
|
fill_mode(A) ::= NULL_F. { A = FILL_MODE_NULL_F; }
|
||||||
fill_mode(A) ::= LINEAR. { A = FILL_MODE_LINEAR; }
|
fill_mode(A) ::= LINEAR. { A = FILL_MODE_LINEAR; }
|
||||||
fill_mode(A) ::= NEXT. { A = FILL_MODE_NEXT; }
|
fill_mode(A) ::= NEXT. { A = FILL_MODE_NEXT; }
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,7 @@ static SKeyword keywordTable[] = {
|
||||||
{"NOT", TK_NOT},
|
{"NOT", TK_NOT},
|
||||||
{"NOW", TK_NOW},
|
{"NOW", TK_NOW},
|
||||||
{"NULL", TK_NULL},
|
{"NULL", TK_NULL},
|
||||||
|
{"NULL_F", TK_NULL_F},
|
||||||
{"NULLS", TK_NULLS},
|
{"NULLS", TK_NULLS},
|
||||||
{"OFFSET", TK_OFFSET},
|
{"OFFSET", TK_OFFSET},
|
||||||
{"ON", TK_ON},
|
{"ON", TK_ON},
|
||||||
|
@ -237,6 +238,7 @@ static SKeyword keywordTable[] = {
|
||||||
{"USERS", TK_USERS},
|
{"USERS", TK_USERS},
|
||||||
{"USING", TK_USING},
|
{"USING", TK_USING},
|
||||||
{"VALUE", TK_VALUE},
|
{"VALUE", TK_VALUE},
|
||||||
|
{"VALUE_F", TK_VALUE_F},
|
||||||
{"VALUES", TK_VALUES},
|
{"VALUES", TK_VALUES},
|
||||||
{"VARCHAR", TK_VARCHAR},
|
{"VARCHAR", TK_VARCHAR},
|
||||||
{"VARIABLES", TK_VARIABLES},
|
{"VARIABLES", TK_VARIABLES},
|
||||||
|
|
|
@ -2817,7 +2817,7 @@ static int32_t convertFillValue(STranslateContext* pCxt, SDataType dt, SNodeList
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t checkFillValues(STranslateContext* pCxt, SFillNode* pFill, SNodeList* pProjectionList) {
|
static int32_t checkFillValues(STranslateContext* pCxt, SFillNode* pFill, SNodeList* pProjectionList) {
|
||||||
if (FILL_MODE_VALUE != pFill->mode) {
|
if (FILL_MODE_VALUE != pFill->mode && FILL_MODE_VALUE_F != pFill->mode) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -178,6 +178,7 @@
|
||||||
,,y,script,./test.sh -f tsim/query/udf_with_const.sim
|
,,y,script,./test.sh -f tsim/query/udf_with_const.sim
|
||||||
,,y,script,./test.sh -f tsim/query/sys_tbname.sim
|
,,y,script,./test.sh -f tsim/query/sys_tbname.sim
|
||||||
,,y,script,./test.sh -f tsim/query/groupby.sim
|
,,y,script,./test.sh -f tsim/query/groupby.sim
|
||||||
|
,,y,script,./test.sh -f tsim/query/forceFill.sim
|
||||||
,,y,script,./test.sh -f tsim/qnode/basic1.sim
|
,,y,script,./test.sh -f tsim/qnode/basic1.sim
|
||||||
,,y,script,./test.sh -f tsim/snode/basic1.sim
|
,,y,script,./test.sh -f tsim/snode/basic1.sim
|
||||||
,,y,script,./test.sh -f tsim/mnode/basic1.sim
|
,,y,script,./test.sh -f tsim/mnode/basic1.sim
|
||||||
|
|
|
@ -0,0 +1,367 @@
|
||||||
|
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 db1;
|
||||||
|
sql create database db1 vgroups 10;
|
||||||
|
sql use db1;
|
||||||
|
sql create stable sta (ts timestamp, f1 double, f2 binary(200)) tags(t1 int);
|
||||||
|
sql create table tba1 using sta tags(1);
|
||||||
|
sql insert into tba1 values ('2022-04-26 15:15:01', 1.0, "a");
|
||||||
|
sql insert into tba1 values ('2022-04-26 15:15:02', 2.0, "b");
|
||||||
|
sql insert into tba1 values ('2022-04-26 15:15:04', 4.0, "b");
|
||||||
|
sql insert into tba1 values ('2022-04-26 15:15:05', 5.0, "b");
|
||||||
|
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:00' and ts <= '2022-04-26 15:15:06' interval(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:00' and ts <= '2022-04-26 15:15:06' interval(1s) fill(value, 8.8);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:00' and ts <= '2022-04-26 15:15:06' interval(1s) fill(null);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:00' and ts <= '2022-04-26 15:15:06' interval(1s) fill(null_f);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:06' and ts <= '2022-04-26 15:15:10' interval(1s) fill(value, 8.8);
|
||||||
|
if $rows != 0 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:06' and ts <= '2022-04-26 15:15:10' interval(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:06' and ts <= '2022-04-26 15:15:10' interval(1s) fill(null);
|
||||||
|
if $rows != 0 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:15:06' and ts <= '2022-04-26 15:15:10' interval(1s) fill(null_f);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:16:00' and ts <= '2022-04-26 19:15:59' interval(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 14400 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select avg(f1) from tba1 where ts >= '2022-04-26 15:16:00' and ts <= '2022-04-26 19:15:59' interval(1s) fill(null_f);
|
||||||
|
if $rows != 14400 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:00','2022-04-26 15:15:06') every(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:00','2022-04-26 15:15:06') every(1s) fill(value, 8.8);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:00','2022-04-26 15:15:06') every(1s) fill(null);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:00','2022-04-26 15:15:06') every(1s) fill(null_f);
|
||||||
|
if $rows != 7 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 2.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 4.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data50 != 5.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data60 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:06','2022-04-26 15:15:10') every(1s) fill(value, 8.8);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:06','2022-04-26 15:15:10') every(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:06','2022-04-26 15:15:10') every(1s) fill(null);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:15:06','2022-04-26 15:15:10') every(1s) fill(null_f);
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data10 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data20 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data30 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data40 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:16:00','2022-04-26 19:15:59') every(1s) fill(value_f, 8.8);
|
||||||
|
if $rows != 14400 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != 8.800000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql select interp(f1) from tba1 range('2022-04-26 15:16:00','2022-04-26 19:15:59') every(1s) fill(null_f);
|
||||||
|
if $rows != 14400 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data00 != NULL then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -14,6 +14,7 @@ sql use test;
|
||||||
|
|
||||||
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));;
|
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));;
|
||||||
sql create stream streams1 trigger at_once into streamt as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value, 100);
|
sql create stream streams1 trigger at_once into streamt as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value, 100);
|
||||||
|
sql create stream streams1a trigger at_once into streamta as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value_f, 100);
|
||||||
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
|
||||||
sleep 100
|
sleep 100
|
||||||
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
|
||||||
|
@ -77,6 +78,69 @@ if $data71 != 1 then
|
||||||
goto loop0
|
goto loop0
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
print "force fill vaule"
|
||||||
|
|
||||||
|
$loop_count = 0
|
||||||
|
|
||||||
|
loop0a:
|
||||||
|
sleep 200
|
||||||
|
sql select * from streamta order by ts;
|
||||||
|
|
||||||
|
$loop_count = $loop_count + 1
|
||||||
|
if $loop_count == 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $rows != 8 then
|
||||||
|
print =====rows=$rows
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data01 != 1 then
|
||||||
|
print =====data01=$data01
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data11 != 1 then
|
||||||
|
print =====data11=$data11
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data21 != 1 then
|
||||||
|
print =====data21=$data21
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data31 != 100 then
|
||||||
|
print =====data31=$data31
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data41 != 1 then
|
||||||
|
print =====data41=$data41
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data51 != 100 then
|
||||||
|
print =====data01=$data01
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data61 != 100 then
|
||||||
|
print =====data61=$data61
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data71 != 1 then
|
||||||
|
print =====data71=$data71
|
||||||
|
goto loop0a
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sql drop stream if exists streams2;
|
sql drop stream if exists streams2;
|
||||||
sql drop database if exists test2;
|
sql drop database if exists test2;
|
||||||
sql create database test2 vgroups 1;
|
sql create database test2 vgroups 1;
|
||||||
|
@ -408,6 +472,7 @@ sql create table t1 using st tags(1,1,1);
|
||||||
sql create table t2 using st tags(2,2,2);
|
sql create table t2 using st tags(2,2,2);
|
||||||
|
|
||||||
sql create stream streams4 trigger at_once into streamt4 as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL);
|
sql create stream streams4 trigger at_once into streamt4 as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL);
|
||||||
|
sql create stream streams4a trigger at_once into streamt4a as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL_F);
|
||||||
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
|
||||||
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
|
||||||
sql insert into t1 values(1648791273000,1,2,3,1.0,'aaa');
|
sql insert into t1 values(1648791273000,1,2,3,1.0,'aaa');
|
||||||
|
@ -512,32 +577,104 @@ if $data[12][3] == NULL then
|
||||||
goto loop4
|
goto loop4
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
print "force fill null"
|
||||||
|
|
||||||
|
|
||||||
|
$loop_count = 0
|
||||||
|
|
||||||
|
loop4a:
|
||||||
|
sleep 200
|
||||||
|
sql select * from streamt4a order by pname, ts;
|
||||||
|
|
||||||
|
print ===> $data[0][0] , $data[0][1] , $data[0][2] , $data[0][3]
|
||||||
|
print ===> $data[1][0] , $data[1][1] , $data[1][2] , $data[1][3]
|
||||||
|
print ===> $data[2][0] , $data[2][1] , $data[2][2] , $data[2][3]
|
||||||
|
print ===> $data[3][0] , $data[3][1] , $data[3][2] , $data[3][3]
|
||||||
|
print ===> $data[4][0] , $data[4][1] , $data[4][2] , $data[4][3]
|
||||||
|
print ===> $data[5][0] , $data[5][1] , $data[5][2] , $data[5][3]
|
||||||
|
print ===> $data[6][0] , $data[6][1] , $data[6][2] , $data[6][3]
|
||||||
|
print ===> $data[7][0] , $data[7][1] , $data[7][2] , $data[7][3]
|
||||||
|
print ===> $data[8][0] , $data[8][1] , $data[8][2] , $data[8][3]
|
||||||
|
print ===> $data[9][0] , $data[9][1] , $data[9][2] , $data[9][3]
|
||||||
|
print ===> $data[10][0] , $data[10][1] , $data[10][2] , $data[10][3]
|
||||||
|
print ===> $data[11][0] , $data[11][1] , $data[11][2] , $data[11][3]
|
||||||
|
print ===> $data[12][0] , $data[12][1] , $data[12][2] , $data[12][3]
|
||||||
|
print ===> $data[13][0] , $data[13][1] , $data[13][2] , $data[13][3]
|
||||||
|
|
||||||
|
$loop_count = $loop_count + 1
|
||||||
|
if $loop_count == 10 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $rows != 14 then
|
||||||
|
print =====rows=$rows
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data11 != NULL then
|
||||||
|
print =====data11=$data11
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data12 != t1aaa then
|
||||||
|
print =====data12=$data12
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data13 == NULL then
|
||||||
|
print =====data13=$data13
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data32 != t1aaa then
|
||||||
|
print =====data32=$data32
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data42 != t1aaa then
|
||||||
|
print =====data42=$data42
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data52 != t1aaa then
|
||||||
|
print =====data52=$data52
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data81 != NULL then
|
||||||
|
print =====data81=$data81
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data82 != t2aaa then
|
||||||
|
print =====data82=$data82
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data83 == NULL then
|
||||||
|
print =====data83=$data83
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data[10][2] != t2aaa then
|
||||||
|
print =====data[10][2]=$data[10][2]
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data[11][2] != t2aaa then
|
||||||
|
print =====data[11][2]=$data[11][2]
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data[12][2] != t2aaa then
|
||||||
|
print =====data[12][2]=$data[12][2]
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data[12][3] == NULL then
|
||||||
|
print =====data[12][3]=$data[12][3]
|
||||||
|
goto loop4a
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue