danny0405 commented on code in PR #18741:
URL: https://github.com/apache/hudi/pull/18741#discussion_r3301196046


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/FlinkRowDataReaderContext.java:
##########
@@ -98,18 +99,27 @@ public ClosableIterator<RowData> getFileRecordIterator(
       HoodieSchema dataSchema,
       HoodieSchema requiredSchema,
       HoodieStorage storage) throws IOException {
-    if 
(filePath.toString().endsWith(HoodieFileFormat.LANCE.getFileExtension())) {
-      throw new 
UnsupportedOperationException(HoodieFileFormat.LANCE_SPARK_ONLY_ERROR_MSG);
-    }
     boolean isLogFile = FSUtils.isLogFile(filePath);
     // disable schema evolution in fileReader if it's log file, since schema 
evolution for log file is handled in `FileGroupRecordBuffer`
     InternalSchemaManager schemaManager = isLogFile ? 
InternalSchemaManager.DISABLED : internalSchemaManager.get();
 
+    if 
(filePath.getName().endsWith(HoodieFileFormat.LANCE.getFileExtension())) {
+      HoodieRowDataLanceReader rowDataLanceReader =
+          (HoodieRowDataLanceReader) HoodieIOFactory.getIOFactory(storage)
+              .getReaderFactory(HoodieRecord.HoodieRecordType.FLINK)
+              .getFileReader(tableConfig, filePath, HoodieFileFormat.LANCE, 
Option.empty());
+      try {
+        return 
rowDataLanceReader.getRowDataIterator(RowDataQueryContexts.fromSchema(requiredSchema).getRowType(),
 requiredSchema);

Review Comment:
   Addressed. Flink Lance now explicitly rejects schema evolution in table 
validation, with a backup guard in `FlinkRowDataReaderContext`. I also added a 
factory test for the validation path.



##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/io/storage/row/HoodieBloomFilterStringWriteSupport.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.io.storage.row;
+
+import org.apache.hudi.avro.HoodieBloomFilterWriteSupport;
+import org.apache.hudi.common.bloom.BloomFilter;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Bloom-filter footer support for Flink RowData Lance writers.
+ */
+class HoodieBloomFilterStringWriteSupport extends 
HoodieBloomFilterWriteSupport<String> {

Review Comment:
   Addressed. I replaced the Lance-specific 
`HoodieBloomFilterStringWriteSupport` with shared 
`HoodieBloomFilterRowDataWriteSupport`, and both RowData Parquet and Lance 
writers now use it.



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