WIP: Update to arrow/parquet 59.2.0 - #24030
Conversation
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
| if let Some(hint) = metadata_size_hint { | ||
| inner = inner.with_footer_size_hint(hint) | ||
| }; | ||
| let location = partitioned_file.object_meta.location; |
There was a problem hiding this comment.
ParquetObjectReader is deprecated due to
| filename: String, | ||
| metadata: Arc<ParquetMetaData>, | ||
| inner: ParquetObjectReader, | ||
| object_store: Arc<dyn ObjectStore>, |
There was a problem hiding this comment.
this is arguable a nicer example now, as it avoids having to wrap the ParquetObjectReader
arrow-rs formalized MapBuilder's default field names from keys/values to key/value to match the Arrow spec (apache/arrow-rs#10297). Update the hardcoded schema in arrow_field()/arrow_metadata() and the nested_struct cast test to match, fixing a StructArray::new panic on mismatched field names.
| let to_write = RecordBatch::try_from_iter(data).unwrap(); | ||
| let path = object_store::path::Path::from(format!("{file_num}.parquet").as_str()); | ||
| let object_store_writer = ParquetObjectWriter::new(Arc::clone(&store) as _, path); | ||
| let object_store_writer = BufWriter::new(Arc::clone(&store) as _, path); |
There was a problem hiding this comment.
ParquetObjectWriter wsas deprecated: apache/arrow-rs#10308
ParquetObjectWriter is a thin wrapper around BufWriter: https://docs.rs/parquet/latest/src/parquet/arrow/async_writer/store.rs.html#72-74
| ) -> BoxFuture<'_, datafusion::parquet::errors::Result<Bytes>> { | ||
| println!("get_bytes: {} Reading range {:?}", self.filename, range); | ||
| self.inner.get_bytes(range) | ||
| let object_store = Arc::clone(&self.object_store); |
There was a problem hiding this comment.
This is due to inlining the logic for ParquetObjectReader
It turns out that DataFusion already has its own copy of the logic of the ParquetObjectReader between ParquetFileReader and CachedParquetFileReader. I have a PR that will unify them:
| struct_type(vec![ | ||
| non_null_field("keys", DataType::Utf8), | ||
| field("values", DataType::Int32), | ||
| non_null_field("key", DataType::Utf8), |
There was a problem hiding this comment.
This change is needed due to
- chore: formalize the default map field names to match default arrow spec arrow-rs#10297
I think we should probably revert that for this minor release and I am working on that upstream
| options: Option<&'a ArrowReaderOptions>, | ||
| ) -> BoxFuture<'a, parquet::errors::Result<Arc<ParquetMetaData>>> { | ||
| self.inner.get_metadata(options) | ||
| let object_meta = self.partitioned_file.object_meta.clone(); |
There was a problem hiding this comment.
THe need for this replication is removed by unifying the structures, as I propose to do do in
|
|
||
| **Migration guide:** | ||
|
|
||
| If your [`AsyncFileReader`] implementation exists mainly to read from an |
There was a problem hiding this comment.
This will need to get updated if we merge this one first
…rrow-rs 59.2.0 Bumping arrow-rs changed the underlying buffer memory footprint reported by ArrayData::get_slice_memory_size() for this scenario, shifting the accumulator's accounted size from 282 to 290 bytes. This is an expected size increase from the dependency bump, not an accounting regression: the merge behavior and both sibling tests (does_not_over_account_memory_distinct/_ordered) are unaffected.
| acc1 = merge(acc1, acc2)?; | ||
|
|
||
| assert_eq!(acc1.size(), 282); | ||
| assert_eq!(acc1.size(), 290); |
There was a problem hiding this comment.
Which issue does this PR close?
59.2.0(July 2026) arrow-rs#9879Rationale for this change
Upgrade to latest arrow / parquet library
What changes are included in this PR?
Are these changes tested?
yes, by CI
Are there any user-facing changes?
Not yet