-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implement serialization for ScalarValue::FixedSizeBinary #3943
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
Merged
alamb
merged 8 commits into
apache:master
from
retikulum:3928_serialization_fixedsizebinary
Oct 26, 2022
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cbfe93a
Implement serialization for ScalarValue::FixedSizeBinary
retikulum 2f1576d
correct test
retikulum 20c0dba
resolve conflict
retikulum 5c290c7
fix formatting
retikulum 7d28188
add none test case for non zero length
retikulum e34d7f2
Merge branch 'master' into 3928_serialization_fixedsizebinary
retikulum a6173b5
resolve conflict
retikulum 5625e1e
Merge branch '3928_serialization_fixedsizebinary' of https://github.c…
retikulum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1033,9 +1033,14 @@ impl TryFrom<&ScalarValue> for protobuf::ScalarValue { | |
| Value::LargeBinaryValue(s.to_owned()) | ||
| }) | ||
| } | ||
| scalar::ScalarValue::FixedSizeBinary(_, _) => Err(Error::General( | ||
| "FixedSizeBinary is not yet implemented".to_owned(), | ||
| )), | ||
| scalar::ScalarValue::FixedSizeBinary(length, val) => { | ||
|
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. ❤️ |
||
| create_proto_scalar(val, &data_type, |s| { | ||
| Value::FixedSizeBinaryValue(protobuf::ScalarFixedSizeBinary { | ||
| values: s.to_owned(), | ||
| length: *length, | ||
| }) | ||
| }) | ||
| } | ||
|
|
||
| datafusion::scalar::ScalarValue::Time64(v) => { | ||
| create_proto_scalar(v, &data_type, |v| Value::Time64Value(*v)) | ||
|
|
||
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.
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: should we follow the actual definition and put the length as the first field (it shouldn't matter much, except aesthetically but I think it keeps the declaration in here and the struct in scalar value consistent).
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.
Thanks for feedback. While I was looking for similar definitons, I came acrros to this and implement it in this way. https://github.com/apache/arrow-datafusion/blob/48f73c6af3b0cc747c38b4a9c7a610f4630e8736/datafusion/proto/proto/datafusion.proto#L711-L714
However, I am open to fix in a way to comply with preferred code style. If this is the only thing that needs to be changed, I will create a commit.