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

Let std::fmt::Debug for StructArray output Null/Validity info #6655

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

XinyuZeng
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

When we are comparing whether two Arrays/RecordBatches are equal (e.g., assert_eq!(array1, array2), we also compare NullBuffer in ArrayData). Right now it is possible that two StructArrays are different because of the struct-level nulls but their debug format strings are the same, which brings confusion for debugging.

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Oct 31, 2024
@tustvold
Copy link
Contributor

tustvold commented Nov 5, 2024

I wonder if we could perhaps truncate this, or just print the null count?

Most of the array implementations cap out after printing the first and last 10 elements to avoid enormous debug output generation.

It isn't ideal, but we want to avoid issues where the debug output is potentially so massive, and takes so long to generate, that panics, etc... just turn into application stalls.

@XinyuZeng
Copy link
Contributor Author

XinyuZeng commented Nov 6, 2024

I reused print_long_array to truncate.

@tustvold tustvold merged commit e1ac2bb into apache:master Nov 6, 2024
26 checks passed
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.

2 participants