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

Fix Display for List #8261

Merged
merged 3 commits into from
Nov 22, 2023
Merged

Fix Display for List #8261

merged 3 commits into from
Nov 22, 2023

Conversation

jayzhan211
Copy link
Contributor

Which issue does this PR close?

Closes #8259.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Nov 18, 2023
)?,
ScalarValue::List(arr) | ScalarValue::FixedSizeList(arr) => {
// TODO: Remove NullArray
// There are NullArray(0) currently, so we need to check the length
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We may file an ticket to track it

@jayzhan211 jayzhan211 marked this pull request as draft November 18, 2023 12:05
write!(f, "[]")?
} else {
let options = FormatOptions::default().with_display_error(true);
// TODO: No way to map to fmt::Error yet
Copy link
Contributor

Choose a reason for hiding this comment

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

https://docs.rs/arrow/latest/arrow/util/display/struct.ArrayFormatter.html#method.try_new says it returns an error if the type can't be formatted. Since this code knows that it is always a ListArray I think it would be ok to simply unwrap the error (ArrayFormatter::try_new(...).unwrap())

@jayzhan211
Copy link
Contributor Author

Continue on this after sql_array_literal fix from #8269

Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
@jayzhan211 jayzhan211 marked this pull request as ready for review November 22, 2023 00:25
Copy link
Contributor

@alamb alamb 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 -- thank you @jayzhan211

@alamb alamb merged commit b46b7c0 into apache:main Nov 22, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explain on a plan containing a list literal is very verbose in v33
2 participants