Repository navigation
fix: fix the missing final window in date_bin_gapfill queries. - #19105
Alchuang22-dev wants to merge 2 commits into
Conversation
|
Thanks for picking this up. I tried this change and hit one edge case: when the last window is
To reproduce it, I built CREATE DATABASE db1;
CREATE TABLE db1.t (time TIMESTAMP TIME, d STRING TAG, v DOUBLE FIELD);
INSERT INTO db1.t(time, d, v) VALUES (9223372036854775806, 'd2', 2.0);
SELECT date_bin_gapfill(1ms, time) AS w, AVG(v) AS a FROM db1.t
WHERE time >= 9223372036854775805 AND time <= 9223372036854775807 GROUP BY 1;Without the change it returns two rows, so the last window is missing, as in #18988. With the change it keeps returning the null row for the last window. When I cut the output off at 300 KB, that row had been repeated 7,861 times. Driving the operator directly in a unit test gives the same result: it does not finish. One way to avoid it is to remember when Also, the description mentions a regression test, but the PR only changes |
|
@PDGGK Thanks for your feedback. Now |
|
Thanks for the update. I reran the earlier checks against 7330aef, with the same setup as before:
Looks good to me. One thought on tests: the existing gap-fill operator tests and the |
Description
Fix #18988
The final group incorrectly treated endTime as exclusive, while gap filling uses an inclusive end boundary. This caused the last window to disappear depending on device filtering or group ordering.
This PR changes the final-group boundary check from < to <= and adds a regression test covering the inclusive final window. Now the final-group boundary is unified as:
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR