cshuo commented on code in PR #19307:
URL: https://github.com/apache/hudi/pull/19307#discussion_r3620856608


##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/table/format/FlinkRecordContext.java:
##########
@@ -174,11 +174,12 @@ public RowData mergeWithEngineRecord(HoodieSchema schema,
   }
 
   @Override
-  public RowData seal(RowData rowData) {
-    if (rowData instanceof BinaryRowData) {
-      return ((BinaryRowData) rowData).copy();
+  public RowData seal(HoodieSchema schema, RowData rowData) {
+    if (rowData instanceof GenericRowData) {
+      return rowData;
     }

Review Comment:
   keep BinaryRowData copy.



##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/lsm/LsmFileGroupReaderUtils.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+package org.apache.hudi.common.table.read.lsm;
+
+import org.apache.hudi.common.engine.HoodieReaderContext;
+import org.apache.hudi.common.model.HoodieBaseFile;
+import org.apache.hudi.common.schema.HoodieSchema;
+import org.apache.hudi.common.table.read.BufferedRecord;
+import org.apache.hudi.common.table.read.BufferedRecordConverter;
+import org.apache.hudi.common.table.read.BufferedRecords;
+import org.apache.hudi.common.table.read.DeleteContext;
+import org.apache.hudi.common.table.read.IteratorMode;
+import org.apache.hudi.common.util.collection.ClosableIterator;
+import org.apache.hudi.common.util.collection.CloseableMappingIterator;
+import org.apache.hudi.storage.HoodieStorage;
+import org.apache.hudi.storage.StoragePathInfo;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Shared iterator helpers for reading RFC-103 LSM file groups.
+ */
+final class LsmFileGroupReaderUtils {
+
+  private LsmFileGroupReaderUtils() {
+  }
+
+  /**
+   * Creates an iterator for an L1/base file.
+   *
+   * <p>For the base-file-only fast path, records are converted according to 
the requested
+   * {@link IteratorMode} and emitted directly. When log files need to be 
merged, every engine record
+   * is converted to a complete {@link BufferedRecord}, including its record 
key and ordering value.
+   */
+  static <T> ClosableIterator<BufferedRecord<T>> createBaseFileIterator(
+      HoodieReaderContext<T> readerContext,
+      HoodieStorage storage,
+      HoodieBaseFile baseFile,
+      long start,
+      long length,
+      List<String> orderingFieldNames,
+      boolean isBaseFileOnly) throws IOException {
+    ClosableIterator<T> baseFileIterator = createBaseEngineRecordIterator(
+        readerContext, storage, baseFile, start, length);
+    return toBufferedRecordIterator(
+        readerContext, baseFileIterator, 
readerContext.getSchemaHandler().getRequiredSchema(),
+        orderingFieldNames, isBaseFileOnly);
+  }
+
+  private static <T> ClosableIterator<T> createBaseEngineRecordIterator(

Review Comment:
   createBaseFileEngineIterator



##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/lsm/LsmFileGroupReaderUtils.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+package org.apache.hudi.common.table.read.lsm;
+
+import org.apache.hudi.common.engine.HoodieReaderContext;
+import org.apache.hudi.common.model.HoodieBaseFile;
+import org.apache.hudi.common.schema.HoodieSchema;
+import org.apache.hudi.common.table.read.BufferedRecord;
+import org.apache.hudi.common.table.read.BufferedRecordConverter;
+import org.apache.hudi.common.table.read.BufferedRecords;
+import org.apache.hudi.common.table.read.DeleteContext;
+import org.apache.hudi.common.table.read.IteratorMode;
+import org.apache.hudi.common.util.collection.ClosableIterator;
+import org.apache.hudi.common.util.collection.CloseableMappingIterator;
+import org.apache.hudi.storage.HoodieStorage;
+import org.apache.hudi.storage.StoragePathInfo;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Shared iterator helpers for reading RFC-103 LSM file groups.
+ */
+final class LsmFileGroupReaderUtils {

Review Comment:
   LsmFileIterators
   move log file iterators here



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