fix: the problem of data loss when interval is used for outer query
This commit is contained in:
parent
d3cd984b75
commit
1059ca6d53
|
@ -713,7 +713,7 @@ static int32_t createWindowLogicNodeByInterval(SLogicPlanContext* pCxt, SInterva
|
||||||
pWindow->windowAlgo = pCxt->pPlanCxt->streamQuery ? INTERVAL_ALGO_STREAM_SINGLE : INTERVAL_ALGO_HASH;
|
pWindow->windowAlgo = pCxt->pPlanCxt->streamQuery ? INTERVAL_ALGO_STREAM_SINGLE : INTERVAL_ALGO_HASH;
|
||||||
pWindow->node.groupAction = GROUP_ACTION_KEEP;
|
pWindow->node.groupAction = GROUP_ACTION_KEEP;
|
||||||
pWindow->node.requireDataOrder = DATA_ORDER_LEVEL_IN_BLOCK;
|
pWindow->node.requireDataOrder = DATA_ORDER_LEVEL_IN_BLOCK;
|
||||||
pWindow->node.resultDataOrder = DATA_ORDER_LEVEL_IN_BLOCK;
|
pWindow->node.resultDataOrder = DATA_ORDER_LEVEL_IN_GROUP;
|
||||||
|
|
||||||
pWindow->pTspk = nodesCloneNode(pInterval->pCol);
|
pWindow->pTspk = nodesCloneNode(pInterval->pCol);
|
||||||
if (NULL == pWindow->pTspk) {
|
if (NULL == pWindow->pTspk) {
|
||||||
|
@ -1416,7 +1416,7 @@ static int32_t adjustProjectDataRequirement(SProjectLogicNode* pProject, EDataOr
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t adjustIntervalDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) {
|
static int32_t adjustIntervalDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) {
|
||||||
if (requirement <= DATA_ORDER_LEVEL_IN_BLOCK) {
|
if (requirement <= DATA_ORDER_LEVEL_IN_GROUP) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
pWindow->node.resultDataOrder = requirement;
|
pWindow->node.resultDataOrder = requirement;
|
||||||
|
|
|
@ -38,6 +38,9 @@ TEST_F(PlanIntervalTest, fill) {
|
||||||
run("SELECT COUNT(*) FROM t1 WHERE ts > TIMESTAMP '2022-04-01 00:00:00' and ts < TIMESTAMP '2022-04-30 23:59:59' "
|
run("SELECT COUNT(*) FROM t1 WHERE ts > TIMESTAMP '2022-04-01 00:00:00' and ts < TIMESTAMP '2022-04-30 23:59:59' "
|
||||||
"INTERVAL(10s) FILL(LINEAR)");
|
"INTERVAL(10s) FILL(LINEAR)");
|
||||||
|
|
||||||
|
run("SELECT COUNT(*) FROM st1 WHERE ts > TIMESTAMP '2022-04-01 00:00:00' and ts < TIMESTAMP '2022-04-30 23:59:59' "
|
||||||
|
"INTERVAL(10s) FILL(LINEAR)");
|
||||||
|
|
||||||
run("SELECT COUNT(*), SUM(c1) FROM t1 "
|
run("SELECT COUNT(*), SUM(c1) FROM t1 "
|
||||||
"WHERE ts > TIMESTAMP '2022-04-01 00:00:00' and ts < TIMESTAMP '2022-04-30 23:59:59' "
|
"WHERE ts > TIMESTAMP '2022-04-01 00:00:00' and ts < TIMESTAMP '2022-04-30 23:59:59' "
|
||||||
"INTERVAL(10s) FILL(VALUE, 10, 20)");
|
"INTERVAL(10s) FILL(VALUE, 10, 20)");
|
||||||
|
|
Loading…
Reference in New Issue