kylebarron commented on code in PR #7334:
URL: https://github.com/apache/arrow-rs/pull/7334#discussion_r2018929612


##########
parquet/src/arrow/async_reader/store.rs:
##########
@@ -45,29 +46,35 @@ use tokio::runtime::Handle;
 /// println!("Found Blob with {}B at {}", meta.size, meta.location);
 ///
 /// // Show Parquet metadata
-/// let reader = ParquetObjectReader::new(storage_container, meta);
+/// let reader = ParquetObjectReader::new(storage_container, meta.location, 
Some(meta.size));
 /// let builder = ParquetRecordBatchStreamBuilder::new(reader).await.unwrap();
 /// print_parquet_metadata(&mut stdout(), builder.metadata());
 /// # }
 /// ```
 #[derive(Clone, Debug)]
 pub struct ParquetObjectReader {
     store: Arc<dyn ObjectStore>,
-    meta: ObjectMeta,
+    path: Path,
+    file_size: Option<usize>,
     metadata_size_hint: Option<usize>,
     preload_column_index: bool,
     preload_offset_index: bool,
     runtime: Option<Handle>,
 }
 
 impl ParquetObjectReader {
-    /// Creates a new [`ParquetObjectReader`] for the provided [`ObjectStore`] 
and [`ObjectMeta`]
+    /// Creates a new [`ParquetObjectReader`] for the provided [`ObjectStore`] 
and [`Path`].
     ///
-    /// [`ObjectMeta`] can be obtained using [`ObjectStore::list`] or 
[`ObjectStore::head`]
-    pub fn new(store: Arc<dyn ObjectStore>, meta: ObjectMeta) -> Self {
+    /// The file size is optional, and if provided, it will ensure that only 
bounded range requests
+    /// are used. If file size is not provided, the reader will use suffix 
range requests to fetch
+    /// the metadata.
+    ///
+    /// The file size can be obtained using [`ObjectStore::list`] or 
[`ObjectStore::head`].
+    pub fn new(store: Arc<dyn ObjectStore>, path: Path, file_size: 
Option<usize>) -> Self {

Review Comment:
   Closed in [`6b94524` 
(#7334)](https://github.com/apache/arrow-rs/pull/7334/commits/6b9452422da698db9cea669c539bbd392c69118b)



##########
parquet/src/arrow/async_reader/store.rs:
##########
@@ -45,29 +46,35 @@ use tokio::runtime::Handle;
 /// println!("Found Blob with {}B at {}", meta.size, meta.location);
 ///
 /// // Show Parquet metadata
-/// let reader = ParquetObjectReader::new(storage_container, meta);
+/// let reader = ParquetObjectReader::new(storage_container, meta.location, 
Some(meta.size));
 /// let builder = ParquetRecordBatchStreamBuilder::new(reader).await.unwrap();
 /// print_parquet_metadata(&mut stdout(), builder.metadata());
 /// # }
 /// ```
 #[derive(Clone, Debug)]
 pub struct ParquetObjectReader {
     store: Arc<dyn ObjectStore>,
-    meta: ObjectMeta,
+    path: Path,
+    file_size: Option<usize>,
     metadata_size_hint: Option<usize>,
     preload_column_index: bool,
     preload_offset_index: bool,
     runtime: Option<Handle>,
 }
 
 impl ParquetObjectReader {
-    /// Creates a new [`ParquetObjectReader`] for the provided [`ObjectStore`] 
and [`ObjectMeta`]
+    /// Creates a new [`ParquetObjectReader`] for the provided [`ObjectStore`] 
and [`Path`].
     ///
-    /// [`ObjectMeta`] can be obtained using [`ObjectStore::list`] or 
[`ObjectStore::head`]
-    pub fn new(store: Arc<dyn ObjectStore>, meta: ObjectMeta) -> Self {
+    /// The file size is optional, and if provided, it will ensure that only 
bounded range requests
+    /// are used. If file size is not provided, the reader will use suffix 
range requests to fetch
+    /// the metadata.
+    ///
+    /// The file size can be obtained using [`ObjectStore::list`] or 
[`ObjectStore::head`].
+    pub fn new(store: Arc<dyn ObjectStore>, path: Path, file_size: 
Option<usize>) -> Self {

Review Comment:
   Resolved in [`6b94524` 
(#7334)](https://github.com/apache/arrow-rs/pull/7334/commits/6b9452422da698db9cea669c539bbd392c69118b)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to