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

github-merge-queue[bot] pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new f9d6260c9113 refactor(trino): drop unreachable read-optimized log-only 
guard in page source (#20862)
f9d6260c9113 is described below

commit f9d6260c9113fcf3960362825e4dbb454b5a52b1
Author: voonhous <[email protected]>
AuthorDate: Mon Nov 23 07:03:26 2026 +0000

    refactor(trino): drop unreachable read-optimized log-only guard in page 
source (#20862)
    
    #20645 made read-optimized split planning skip log-only file groups, so
    HudiPageSourceProvider can no longer receive a COPY_ON_WRITE-typed split 
with
    log files and no base file. Remove that branch and its TODO so the split
    factory is the single place this is decided, and note in HudiSplitFactory
    why log-only file groups have nothing to read.
---
 .../java/io/trino/plugin/hudi/HudiPageSourceProvider.java    | 12 ------------
 .../java/io/trino/plugin/hudi/split/HudiSplitFactory.java    |  1 +
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git 
a/hudi-trino/src/main/java/io/trino/plugin/hudi/HudiPageSourceProvider.java 
b/hudi-trino/src/main/java/io/trino/plugin/hudi/HudiPageSourceProvider.java
index cee3c74dba07..d923572dfab8 100644
--- a/hudi-trino/src/main/java/io/trino/plugin/hudi/HudiPageSourceProvider.java
+++ b/hudi-trino/src/main/java/io/trino/plugin/hudi/HudiPageSourceProvider.java
@@ -57,7 +57,6 @@ import org.apache.avro.generic.IndexedRecord;
 import org.apache.hudi.common.config.RecordMergeMode;
 import org.apache.hudi.common.config.TypedProperties;
 import org.apache.hudi.common.model.FileSlice;
-import org.apache.hudi.common.model.HoodieTableType;
 import org.apache.hudi.common.schema.HoodieSchema;
 import org.apache.hudi.common.table.HoodieTableConfig;
 import org.apache.hudi.common.table.HoodieTableMetaClient;
@@ -168,17 +167,6 @@ public class HudiPageSourceProvider
             return new EmptyPageSource();
         }
 
-        // Handle MERGE_ON_READ tables to be read in read_optimized mode
-        // IMPORTANT: These tables will have a COPY_ON_WRITE table, see: 
`HudiTableTypeUtils#fromInputFormat`
-        // TODO: Move this check into a higher calling stack, such that the 
split is not created at all
-        if 
(hudiTableHandle.getTableType().equals(HoodieTableType.COPY_ON_WRITE) && 
!hudiSplit.getLogFiles().isEmpty()) {
-            if (hudiBaseFileOpt.isEmpty()) {
-                // Handle hasLogFiles=true, hasBaseFile = false
-                // Ignoring log files without base files, no data required to 
be read
-                return new EmptyPageSource();
-            }
-        }
-
         long start = 0;
         long length = 10;
         if (hudiBaseFileOpt.isPresent()) {
diff --git 
a/hudi-trino/src/main/java/io/trino/plugin/hudi/split/HudiSplitFactory.java 
b/hudi-trino/src/main/java/io/trino/plugin/hudi/split/HudiSplitFactory.java
index 72a28356cb0e..3bdacf5dcca4 100644
--- a/hudi-trino/src/main/java/io/trino/plugin/hudi/split/HudiSplitFactory.java
+++ b/hudi-trino/src/main/java/io/trino/plugin/hudi/split/HudiSplitFactory.java
@@ -82,6 +82,7 @@ public class HudiSplitFactory
         if (isCopyOnWriteOrReadOptimized(hudiTableHandle, fileSlice)) {
             // Handle MERGE_ON_READ tables to be read in read_optimized mode
             // IMPORTANT: These tables will have a COPY_ON_WRITE table type 
due to how `HudiTableTypeUtils#fromInputFormat`
+            // Read-optimized reads ignore log files, so a log-only file group 
has nothing to read
             if (fileSlice.getBaseFile().isEmpty()) {
                 return ImmutableList.of();
             }

Reply via email to