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

File writer preserve dict bug #6711

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

brancz
Copy link
Contributor

@brancz brancz commented Nov 10, 2024

Which issue does this PR close?

Closes #6710

Rationale for this change

See issue.

What changes are included in this PR?

Fix writing of IPC files where dict IDs are not preserved.

Are there any user-facing changes?

No user-facing changes, only a bug fix.

@tustvold @alamb

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.

Thank you @brancz . Nice find!

@@ -1702,6 +1702,41 @@ mod tests {
assert_eq!(batch, roundtrip_ipc(&batch));
}

#[test]
fn test_roundtrip_nested_dict_no_preserve_dict_id() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I verified that this test covers the bugfix by reverting the code changes and running the tests:

called `Result::unwrap()` on an `Err` value: InvalidArgumentError("dictionary id 0 not found in schema")
thread 'reader::tests::test_roundtrip_nested_dict_no_preserve_dict_id' panicked at arrow-ipc/src/reader.rs:1735:79:
called `Result::unwrap()` on an `Err` value: InvalidArgumentError("dictionary id 0 not found in schema")

@alamb alamb merged commit 5a86db3 into apache:master Nov 15, 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.

IPC file writer produces incorrect footer when not preserving dict ID
2 participants