You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by tu...@apache.org on 2022/06/29 09:28:58 UTC

[arrow-rs] branch master updated: Use InMemoryColumnChunkReader (#1956)

This is an automated email from the ASF dual-hosted git repository.

tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 314d00f11 Use InMemoryColumnChunkReader (#1956)
314d00f11 is described below

commit 314d00f11a7c3f003654a69bb02cedb7f41a9ae9
Author: Raphael Taylor-Davies <17...@users.noreply.github.com>
AuthorDate: Wed Jun 29 10:28:53 2022 +0100

    Use InMemoryColumnChunkReader (#1956)
---
 parquet/src/arrow/async_reader.rs | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/parquet/src/arrow/async_reader.rs b/parquet/src/arrow/async_reader.rs
index 3f14114e3..2400a0b6a 100644
--- a/parquet/src/arrow/async_reader.rs
+++ b/parquet/src/arrow/async_reader.rs
@@ -83,7 +83,7 @@ use std::pin::Pin;
 use std::sync::Arc;
 use std::task::{Context, Poll};
 
-use bytes::{Buf, Bytes};
+use bytes::Bytes;
 use futures::future::{BoxFuture, FutureExt};
 use futures::stream::Stream;
 use parquet_format::PageType;
@@ -102,7 +102,6 @@ use crate::compression::{create_codec, Codec};
 use crate::errors::{ParquetError, Result};
 use crate::file::footer::{decode_footer, decode_metadata};
 use crate::file::metadata::ParquetMetaData;
-use crate::file::reader::SerializedPageReader;
 use crate::file::serialized_reader::{decode_page, read_page_header};
 use crate::file::FOOTER_SIZE;
 use crate::schema::types::{ColumnDescPtr, SchemaDescPtr, SchemaDescriptor};
@@ -474,13 +473,7 @@ struct InMemoryColumnChunk {
 
 impl InMemoryColumnChunk {
     fn pages(&self) -> Result<Box<dyn PageReader>> {
-        let page_reader = SerializedPageReader::new(
-            self.data.clone().reader(),
-            self.num_values,
-            self.compression,
-            self.physical_type,
-        )?;
-
+        let page_reader = InMemoryColumnChunkReader::new(self.clone())?;
         Ok(Box::new(page_reader))
     }
 }
@@ -495,7 +488,7 @@ struct InMemoryColumnChunkReader {
 
 impl InMemoryColumnChunkReader {
     /// Creates a new serialized page reader from file source.
-    pub fn new(chunk: InMemoryColumnChunk) -> Result<Self> {
+    fn new(chunk: InMemoryColumnChunk) -> Result<Self> {
         let decompressor = create_codec(chunk.compression)?;
         let result = Self {
             chunk,