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 - WITH FILL would produce abort when FillingTransform processing empty block #46897

Merged
merged 2 commits into from
Feb 26, 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
3 changes: 3 additions & 0 deletions src/Processors/Transforms/FillingTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ void FillingTransform::transform(Chunk & chunk)
if (on_totals)
return;

if (!chunk.hasRows() && !generate_suffix)
return;

Columns old_fill_columns;
Columns old_interpolate_columns;
Columns old_other_columns;
Expand Down
11 changes: 11 additions & 0 deletions tests/queries/0_stateless/25339_fill_empty_chunk.reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
1 \N
2 \N
2 \N
2 \N
3 \N
4 \N
5 \N
6 \N
7 \N
8 \N
9 \N
10 changes: 10 additions & 0 deletions tests/queries/0_stateless/25339_fill_empty_chunk.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- this SELECT produces empty chunk in FillingTransform

SELECT
2 AS x,
arrayJoin([NULL, NULL, NULL])
GROUP BY
GROUPING SETS (
(0),
([NULL, NULL, NULL]))
ORDER BY x ASC WITH FILL FROM 1 TO 10;