-
Notifications
You must be signed in to change notification settings - Fork 1.1k
DeltaBitPackEncoderConversion: Fix panic message on invalid type #9552
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
Merged
alamb
merged 7 commits into
apache:main
from
progval:DeltaBitPackEncoderConversion-error-msg
Mar 17, 2026
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6d517de
DeltaBitPackEncoderConversion: Fix panic message on invalid type
progval 1184a12
Merge branch 'main' into DeltaBitPackEncoderConversion-error-msg
Dandandan 298298d
Add test
progval 21f42c0
Make sure arrow_writer only runs with the arrow feature
alamb 113885e
Update parquet/tests/arrow_writer.rs
alamb 3daf8de
Merge branch 'DeltaBitPackEncoderConversion-error-msg' of https://git…
alamb c3c560c
Merge remote-tracking branch 'apache/main' into DeltaBitPackEncoderCo…
alamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| //! Tests that the ArrowWriter correctly lays out values into multiple pages | ||
alamb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| use arrow::array::Float64Array; | ||
| use arrow::datatypes::{DataType, Field, Schema}; | ||
| use arrow::record_batch::RecordBatch; | ||
| use parquet::arrow::ArrowWriter; | ||
| use parquet::basic::Encoding; | ||
| use parquet::file::properties::WriterProperties; | ||
| use std::sync::Arc; | ||
|
|
||
| #[test] | ||
| #[should_panic( | ||
| expected = "DeltaBitPackDecoder only supports Int32Type, UInt32Type, Int64Type, and UInt64Type" | ||
| )] | ||
| fn test_delta_bit_pack_type() { | ||
| let props = WriterProperties::builder() | ||
| .set_column_encoding("col".into(), Encoding::DELTA_BINARY_PACKED) | ||
| .build(); | ||
|
|
||
| let record_batch = RecordBatch::try_new( | ||
| Arc::new(Schema::new(vec![Field::new( | ||
| "col", | ||
| DataType::Float64, | ||
| false, | ||
| )])), | ||
| vec![Arc::new(Float64Array::from_iter_values(vec![1., 2.]))], | ||
| ) | ||
| .unwrap(); | ||
|
|
||
| let mut buffer = Vec::new(); | ||
| let mut writer = ArrowWriter::try_new(&mut buffer, record_batch.schema(), Some(props)).unwrap(); | ||
| let _ = writer.write(&record_batch); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it is strange to have a new integration test just for this error message, I agree starting to have an arrow_writer suite is a good step forward