Skip to content
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

feat: JSON encoding of FixedSizeList #5646

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

hiltontj
Copy link
Contributor

Which issue does this PR close?

Closes #5568.

Rationale for this change

See #5568.

What changes are included in this PR?

Added ability to encode the FixedSizeList type in JSON via the FixedSizeListEncoder. The implementation of FixedSizeListEncoder is very similar to that of ListEncoder, but is somewhat simpler, because of the constant offset.

A test was added to verify behaviour of the JSON encoder with and without explicit nulls.

Are there any user-facing changes?

No.

Added ability to encode the FixedSizeList type in JSON. The implementation
of FixedSizeListEncoder is very similar to that of ListEncoder, but is
somewhat simpler, because of the constant offset.

A test was added to verify behaviour of the JSON encoder with and without
explicit nulls.
@github-actions github-actions bot added the arrow Changes to the arrow crate label Apr 15, 2024
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, nice to see #5318 paying off

let array = Arc::new(list_builder.finish()) as ArrayRef;
let batch = RecordBatch::try_new(schema, vec![array]).unwrap();

//encode and check JSON with explicit nulls:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@tustvold tustvold merged commit 0d031cc into apache:master Apr 15, 2024
22 checks passed
@colin99d
Copy link

@hiltontj thank you for doing this! I really appreciate it.

@hiltontj hiltontj deleted the json-fixed-size-list branch April 15, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make FixedSizedList Json serializable
3 participants