[Json] Support FixedSizeList in json decoder#9715
Merged
alamb merged 2 commits intoapache:mainfrom Apr 21, 2026
Merged
Conversation
58a95fc to
9ed71fc
Compare
Jefffrey
approved these changes
Apr 19, 2026
Contributor
Jefffrey
left a comment
There was a problem hiding this comment.
There's a fun little degenerate test case here:
#[test]
fn test_fixed_size_list_zero_size() {
let buf = r#"
{"a": []}
{"a": null}
{"a": []}
"#;
let field = Field::new_list_field(DataType::Int32, true);
let schema = Arc::new(Schema::new(vec![Field::new(
"a",
DataType::FixedSizeList(Arc::new(field), 0),
false,
)]));
let batches = do_read(buf, 1024, false, false, schema);
assert_eq!(batches.len(), 1);
let col = batches[0].column(0).as_fixed_size_list();
assert_eq!(col.len(), 3);
assert_eq!(col.value_length(), 0);
let values = col.values().as_primitive::<Int32Type>();
assert!(values.values().is_empty());
}It seems to panic within struct array decoding. Could be worth exploring in this PR if there is capacity, though considering this PR is adding a new feature I wouldn't block it on this case.
|
|
||
| let mut nulls = self | ||
| .is_nullable | ||
| .then(|| BooleanBufferBuilder::new(pos.len())); |
Contributor
There was a problem hiding this comment.
Is it worth considering using NullBufferBuilder here instead?
Contributor
There was a problem hiding this comment.
Filed a ticket to track
Contributor
Filed a ticket to track |
Contributor
|
Thank you @liamzwbao and @Jefffrey |
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?
FixedSizeListin arrow-json reader #9714.Rationale for this change
What changes are included in this PR?
Implement decoder for FixedSizeList
Are these changes tested?
Yes
Are there any user-facing changes?
New decoding type supported