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

Only require compatible batch schema in ArrowWriter #4027

Merged

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Apr 6, 2023

Which issue does this PR close?

Relates to #4023

Rationale for this change

We should only require that the batches have a compatible schema, not that they necessarily have the exact same schema.

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the parquet Changes to the parquet crate label Apr 6, 2023
@@ -2358,4 +2361,51 @@ mod tests {
let actual = pretty_format_batches(&batches).unwrap().to_string();
assert_eq!(actual, expected);
}

#[test]
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 these tests fail without the code change:


---- arrow::arrow_writer::tests::test_arrow_writer_metadata stdout ----
thread 'arrow::arrow_writer::tests::test_arrow_writer_metadata' panicked at 'called `Result::unwrap()` on an `Err` value: ArrowError("Record batch schema does not match writer schema")', parquet/src/arrow/arrow_writer/mod.rs:2380:30
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/result.rs:1790:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/result.rs:1112:23
   4: parquet::arrow::arrow_writer::tests::test_arrow_writer_metadata
             at ./src/arrow/arrow_writer/mod.rs:2380:9
   5: parquet::arrow::arrow_writer::tests::test_arrow_writer_metadata::{{closure}}
             at ./src/arrow/arrow_writer/mod.rs:2363:37
   6: core::ops::function::FnOnce::call_once
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- arrow::arrow_writer::tests::test_arrow_writer_nullable stdout ----
thread 'arrow::arrow_writer::tests::test_arrow_writer_nullable' panicked at 'called `Result::unwrap()` on an `Err` value: ArrowError("Record batch schema does not match writer schema")', parquet/src/arrow/arrow_writer/mod.rs:2399:30
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/result.rs:1790:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/result.rs:1112:23
   4: parquet::arrow::arrow_writer::tests::test_arrow_writer_nullable
             at ./src/arrow/arrow_writer/mod.rs:2399:9
   5: parquet::arrow::arrow_writer::tests::test_arrow_writer_nullable::{{closure}}
             at ./src/arrow/arrow_writer/mod.rs:2385:37
   6: core::ops::function::FnOnce::call_once
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants