You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2022/11/09 12:07:04 UTC
[arrow-datafusion] branch master updated: Remove BoxedAsyncFileReader (#4150)
This is an automated email from the ASF dual-hosted git repository.
liukun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/master by this push:
new 0f18e76f1 Remove BoxedAsyncFileReader (#4150)
0f18e76f1 is described below
commit 0f18e76f19306072432da18b707cb68e457ffbfe
Author: Raphael Taylor-Davies <17...@users.noreply.github.com>
AuthorDate: Thu Nov 10 01:06:59 2022 +1300
Remove BoxedAsyncFileReader (#4150)
---
.../core/src/physical_plan/file_format/parquet.rs | 40 ++--------------------
1 file changed, 3 insertions(+), 37 deletions(-)
diff --git a/datafusion/core/src/physical_plan/file_format/parquet.rs b/datafusion/core/src/physical_plan/file_format/parquet.rs
index 270271d43..54701f82d 100644
--- a/datafusion/core/src/physical_plan/file_format/parquet.rs
+++ b/datafusion/core/src/physical_plan/file_format/parquet.rs
@@ -373,13 +373,13 @@ impl FileOpener for ParquetOpener {
&self.metrics,
);
- let reader =
- BoxedAsyncFileReader(self.parquet_file_reader_factory.create_reader(
+ let reader: Box<dyn AsyncFileReader> =
+ self.parquet_file_reader_factory.create_reader(
self.partition_index,
file_meta,
self.metadata_size_hint,
&self.metrics,
- )?);
+ )?;
let schema_adapter = SchemaAdapter::new(self.table_schema.clone());
let batch_size = self.batch_size;
@@ -598,40 +598,6 @@ impl ParquetFileReaderFactory for DefaultParquetFileReaderFactory {
}
}
-///
-/// BoxedAsyncFileReader has been created to satisfy type requirements of
-/// parquet stream builder constructor.
-///
-/// Temporary pending https://github.com/apache/arrow-rs/pull/2368
-struct BoxedAsyncFileReader(Box<dyn AsyncFileReader + Send>);
-
-impl AsyncFileReader for BoxedAsyncFileReader {
- fn get_bytes(
- &mut self,
- range: Range<usize>,
- ) -> BoxFuture<'_, ::parquet::errors::Result<Bytes>> {
- self.0.get_bytes(range)
- }
-
- fn get_byte_ranges(
- &mut self,
- ranges: Vec<Range<usize>>,
- ) -> BoxFuture<'_, parquet::errors::Result<Vec<Bytes>>>
- // TODO: This where bound forces us to enable #![allow(where_clauses_object_safety)] (#3081)
- // Upstream issue https://github.com/apache/arrow-rs/issues/2372
- where
- Self: Send,
- {
- self.0.get_byte_ranges(ranges)
- }
-
- fn get_metadata(
- &mut self,
- ) -> BoxFuture<'_, ::parquet::errors::Result<Arc<ParquetMetaData>>> {
- self.0.get_metadata()
- }
-}
-
/// Wraps parquet statistics in a way
/// that implements [`PruningStatistics`]
struct RowGroupPruningStatistics<'a> {