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

Add support for FixedSizeList in array_to_json_array #4361

Merged
merged 3 commits into from
Jun 5, 2023

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented Jun 4, 2023

Which issue does this PR close?

Closes #4248

What changes are included in this PR?

Makes use of the ability to convert FixedSizeList to ListArray introduced in this PR #4273 to enable array_to_json_array to now support converting FixedSizeList`.

Are there any user-facing changes?

No, although the function array_to_json_array gains ability to work with one more array type

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 4, 2023
@@ -190,6 +190,15 @@ pub fn array_to_json_array(array: &ArrayRef) -> Result<Vec<Value>, ArrowError> {
None => Ok(Value::Null),
})
.collect(),
DataType::FixedSizeList(_, _) => {
ListArray::from(as_fixed_size_list_array(array).to_owned())
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to use ArrayIter directly without needing to convert to a ListArray. Could probably add iter() to FixedSizeListArray also to make this more discoverable...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated as suggested. Including adding iter() to FixedSizeListArray

@dadepo dadepo requested a review from tustvold June 4, 2023 15:57
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.

Thank you

@tustvold tustvold merged commit ac9c6fa into apache:master Jun 5, 2023
@dadepo dadepo deleted the fixedsizelist-array-to-json-array branch June 5, 2023 20:14
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.

Have array_to_json_array support FixedSizeList
2 participants