-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fixes 3 bugs during serialization and deserialization of physical plans #16858
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -859,6 +859,7 @@ message PhysicalScalarUdfNode { | |
| optional bytes fun_definition = 3; | ||
| datafusion_common.ArrowType return_type = 4; | ||
| bool nullable = 5; | ||
| string return_field_name = 6; | ||
|
Contributor
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. Fix for bug 3 that does not serialize ScarlarFunction name |
||
| } | ||
|
|
||
| message PhysicalAggregateExprNode { | ||
|
|
@@ -870,6 +871,7 @@ message PhysicalAggregateExprNode { | |
| bool distinct = 3; | ||
| bool ignore_nulls = 6; | ||
| optional bytes fun_definition = 7; | ||
| string human_display = 8; | ||
|
Contributor
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. Fix for bug 1 that does not serialize human_display for aggregate function |
||
| } | ||
|
|
||
| message PhysicalWindowExprNode { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -368,7 +368,12 @@ pub fn parse_physical_expr( | |
| e.name.as_str(), | ||
| scalar_fun_def, | ||
| args, | ||
| Field::new("f", convert_required!(e.return_type)?, true).into(), | ||
| Field::new( | ||
| &e.return_field_name, | ||
| convert_required!(e.return_type)?, | ||
| true, | ||
|
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. I wonder if this field could ever be non nullable, for example for udfs defined by DF users, then the deserialization would result in a mismatch (not in the scope of this fixes though)
Contributor
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 change here is to use
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. I was refering to the nullability of the return |
||
| ) | ||
| .into(), | ||
| ) | ||
| .with_nullable(e.nullable), | ||
| ) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
One of the places that fixes bug 2 that should return nothing for non-groupby
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.
I wonder if we should look into changing
group_expr: Option<&[Expr]>or something so the compiler makes it more likely that we handle the difference between an emptyVecvsNone`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.
Let me try
Uh oh!
There was an error while loading. Please reload this page.
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.
@alamb : I had a look. This would be very challenging and a lot of changes needed in physical plan, logical plan, parsing logic, serialization/deserialization. I do not think we want to make a big change just for this
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.
Maybe something we can ask an AI agent to try in a follow on PR
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.
I did, and those were the results I got. It even flagged a semantic error due to not distinguishing between no group and an empty one. Coding without AI these days feels almost impossible. 😄