Support casting to/from DataType::Null in cast kernel#1572
Merged
yjshen merged 3 commits intoapache:masterfrom Apr 18, 2022
Merged
Support casting to/from DataType::Null in cast kernel#1572yjshen merged 3 commits intoapache:masterfrom
DataType::Null in cast kernel#1572yjshen merged 3 commits intoapache:masterfrom
Conversation
Contributor
Author
|
@alamb @Dandandan plz have a review, thank you. |
Codecov Report
@@ Coverage Diff @@
## master #1572 +/- ##
==========================================
+ Coverage 82.87% 82.93% +0.05%
==========================================
Files 193 193
Lines 55304 55343 +39
==========================================
+ Hits 45835 45897 +62
+ Misses 9469 9446 -23
Continue to review full report at Codecov.
|
tustvold
approved these changes
Apr 16, 2022
Contributor
tustvold
left a comment
There was a problem hiding this comment.
This looks good to me, thank you 👍. Left some minor test suggestions
| | Map(_, _) | ||
| | Dictionary(_, _), | ||
| Null, | ||
| ) => Ok(new_null_array(to_type, array.len())), |
Contributor
There was a problem hiding this comment.
I've confirmed that these types are all supported by new_null_array
arrow/src/compute/kernels/cast.rs
Outdated
| // cast null from and to struct | ||
| let data_type = | ||
| DataType::Struct(vec![Field::new("data", DataType::Int64, false)]); | ||
| cast_from_and_to_null!(data_type); |
| } | ||
|
|
||
| #[test] | ||
| fn test_cast_null_from_and_to_variable_sized() { |
Contributor
There was a problem hiding this comment.
Maybe fixed size also whilst here?
Contributor
Author
Contributor
Author
|
cc @alamb @Dandandan @yjshen PTAL, thank you. |
9 tasks
DataType::Null from and to othersDataType::Null in cast kernel
Contributor
Author
yjshen
approved these changes
Apr 18, 2022
alamb
pushed a commit
to alamb/arrow-rs
that referenced
this pull request
Apr 18, 2022
* cast null from and to others * fmt fix * add more ut Co-authored-by: duripeng <[email protected]>
Contributor
|
Thanks @yjshen ❤️ |
WinkerDu
added a commit
to WinkerDu/arrow-rs
that referenced
this pull request
Apr 23, 2022
* cast null from and to others * fmt fix * add more ut Co-authored-by: duripeng <[email protected]>
This was referenced Apr 28, 2022
MazterQyou
pushed a commit
to cube-js/arrow-rs
that referenced
this pull request
Jun 9, 2023
* cast null from and to others * fmt fix * add more ut Co-authored-by: duripeng <[email protected]>
MazterQyou
pushed a commit
to cube-js/arrow-rs
that referenced
this pull request
Jun 9, 2023
* cast null from and to others * fmt fix * add more ut Co-authored-by: duripeng <[email protected]>
MazterQyou
pushed a commit
to cube-js/arrow-rs
that referenced
this pull request
Jan 19, 2024
* cast null from and to others * fmt fix * add more ut Co-authored-by: duripeng <[email protected]>
MazterQyou
pushed a commit
to cube-js/arrow-rs
that referenced
this pull request
Feb 5, 2024
* cast null from and to others * fmt fix * add more ut Co-authored-by: duripeng <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #684.
Rationale for this change
Casting from
DataType::Nullto many other types is not allowed for now, likeDataType::Null<->DataType::Utf8, apache/arrow-datafusion#1188 depends on this casting ability to solveNULLconstant issue in function callWhat changes are included in this PR?
Allow casting
DataType::Nullfrom and to most of types except forDataType::UnionandDataType::Decimal, which is not supported inarrow-rs/arrow/src/array/array.rs
Line 440 in 5dca6f0
Are there any user-facing changes?
No.