linliu-code commented on code in PR #690:
URL: https://github.com/apache/hudi-rs/pull/690#discussion_r3848450931


##########
crates/core/src/file_group/base_file/hfile.rs:
##########
@@ -0,0 +1,368 @@
+/*
+ * 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.
+ */
+
+//! HFile implementation of [`BaseFileReader`].
+//!
+//! Reads an HFile base file, the base-file format of Hudi's metadata table.
+
+use std::sync::Arc;
+
+use arrow::array::{ArrayRef, BinaryArray, RecordBatch, RecordBatchOptions, 
StringArray};
+use arrow_schema::{DataType, Field, Schema, SchemaRef};
+use futures::StreamExt;
+use futures::future::BoxFuture;
+use object_store::path::Path as ObjPath;
+
+use super::reader::{BaseFileReadOptions, BaseFileReader, BaseFileStream};
+use crate::hfile::HFileReader;
+use crate::statistics::{StatisticsContainer, StatsGranularity};
+use crate::storage::Storage;
+use crate::storage::error::{Result, StorageError};
+use crate::storage::file_metadata::FileMetadata;
+use crate::storage::util::join_url_segments;
+
+const DEFAULT_BATCH_SIZE: usize = 8192;
+
+/// An HFile read holds the whole file in memory, because the decoder is
+/// constructed from a byte buffer. That is bounded here rather than left to
+/// exhaust the heap: a key-seeking reader, which reads a block at a time, is a
+/// separate piece of work, and until it exists a base file above this size is
+/// refused instead of being loaded. Only the metadata table's `files` 
partition
+/// is read by full scan today, and its base files are orders of magnitude
+/// smaller than this bound.
+const MAX_BUFFERED_FILE_SIZE: u64 = 256 * 1024 * 1024;

Review Comment:
   Does java reader have the same buffer size?



-- 
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