-
Notifications
You must be signed in to change notification settings - Fork 3
Add util functions for masking in select #97
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 | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,99 @@ | ||||||
| use std::sync::Arc; | ||||||
|
|
||||||
| use arrow::datatypes::{DataType, Field, FieldRef}; | ||||||
|
||||||
| use arrow::datatypes::{DataType, Field, FieldRef}; | |
| use arrow::datatypes::DataType; |
Copilot
AI
Sep 30, 2025
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.
The ExprSchemable and ReturnFieldArgs imports are unused in this file. Consider removing them to keep imports clean.
| ColumnarValue, ExprSchemable, ReturnFieldArgs, ScalarUDF, ScalarUDFImpl, Signature, | |
| ColumnarValue, ScalarUDF, ScalarUDFImpl, Signature, |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,99 @@ | ||||||||||||||||||||
| use std::sync::Arc; | ||||||||||||||||||||
|
||||||||||||||||||||
| use std::sync::Arc; |
Copilot
AI
Sep 30, 2025
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.
The Field and FieldRef imports from arrow::datatypes are unused in this file. Consider removing them to keep imports clean.
| use arrow::datatypes::{DataType, Field, FieldRef}; | |
| use arrow::datatypes::DataType; |
Copilot
AI
Sep 30, 2025
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.
The ExprSchemable and ReturnFieldArgs imports are unused in this file. Consider removing them to keep imports clean.
| ColumnarValue, ExprSchemable, ReturnFieldArgs, ScalarUDF, ScalarUDFImpl, Signature, | |
| ColumnarValue, ScalarUDF, ScalarUDFImpl, Signature, |
Copilot
AI
Sep 30, 2025
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.
The simplification logic is incorrect for mask_if_null. When the first argument is known to be non-null, the function should return null, not the second argument. The correct simplification should be Ok(ExprSimplifyResult::Simplified(Expr::Literal(datafusion::scalar::ScalarValue::Null))).
| // If the first argument is known to be non-null, we can simplify to the second argument | |
| if let Ok(false) = info.nullable(&left) { | |
| return Ok(ExprSimplifyResult::Simplified(right)); | |
| // If the first argument is known to be non-null, we can simplify to null | |
| if let Ok(false) = info.nullable(&left) { | |
| return Ok(ExprSimplifyResult::Simplified(Expr::Literal( | |
| datafusion::scalar::ScalarValue::Null, | |
| None, | |
| ))); |
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.
The
std::sync::Arcimport is unused in this file. Consider removing it to keep imports clean.