Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fill operator with desc ts order returned 1 more rows #22532

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions source/libs/executor/src/filloperator.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ static void revisedFillStartKey(SFillOperatorInfo* pInfo, SSDataBlock* pBlock, i
}

// todo time window chosen problem: t or prev value?
if (t > pInfo->pFillInfo->start) t -= pInterval->sliding;
taosFillUpdateStartTimestampInfo(pInfo->pFillInfo, t);
}
}
Expand Down
9 changes: 9 additions & 0 deletions tests/system-test/2-query/fill_with_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,18 @@ def test_partition_by_with_interval_fill_prev_new_group_fill_error(self):
for j in range(0,60):
tdSql.checkData(i*1500+j, 1, None)

def test_fill_with_order_by(self):
sql = "select _wstart, _wend, count(ts), sum(c1) from meters where ts > '2018-11-25 00:00:00.000' and ts < '2018-11-26 00:00:00.00' interval(1d) fill(NULL) order by _wstart"
tdSql.query(sql)
tdSql.checkRows(1)
sql = "select _wstart, _wend, count(ts), sum(c1) from meters where ts > '2018-11-25 00:00:00.000' and ts < '2018-11-26 00:00:00.00' interval(1d) fill(NULL) order by _wstart desc"
tdSql.query(sql)
tdSql.checkRows(1)

def run(self):
self.prepareTestEnv()
self.test_partition_by_with_interval_fill_prev_new_group_fill_error()
self.test_fill_with_order_by()

def stop(self):
tdSql.close()
Expand Down