-
Notifications
You must be signed in to change notification settings - Fork 3k
Spark: Fix aggregate pushdown #15070
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -740,6 +740,7 @@ public void testNaN() { | |
| sql( | ||
| "INSERT INTO %s VALUES (1, float('nan'))," | ||
| + "(1, float('nan')), " | ||
| + "(1, 10.0), " | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bug is replicated with this change in test class. Once this approach is okay, I shall update the testClasses in other spark versions.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain why the bug is triggered with the addition of this row?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basically the bug is triggered when we have data file containing nan count, upper bound and lower bound. Previously without that line only nan count is created, with this change upper and lower bound is generated.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, it's a bit unclear to me why the additional row would trigger collecting lower/upper bounds. I'd have to double check if there's some minimum threshold of rows or some other condition that controls whether lower/upper is written when the footer is written. Looking at this test without the change I would've expected a lower/upper bounds of 1.0 and 2.0 respectively.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the floating-point nature of the 10.0 value? |
||
| + "(2, 2), " | ||
| + "(2, float('nan')), " | ||
| + "(3, float('nan')), " | ||
|
|
@@ -762,7 +763,7 @@ public void testNaN() { | |
|
|
||
| List<Object[]> actual = sql(select, tableName); | ||
| List<Object[]> expected = Lists.newArrayList(); | ||
| expected.add(new Object[] {6L, Float.NaN, 1.0F, 6L}); | ||
| expected.add(new Object[] {7L, Float.NaN, 1.0F, 7L}); | ||
| assertEquals("expected and actual should equal", expected, actual); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we extract a small helper (e.g., hasNaNs) to keep this logic in one place?