diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java index fb36b0399470eb..0e452b04939ab0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java @@ -656,6 +656,13 @@ public PlanFragment visitPhysicalFileScan(PhysicalFileScan fileScan, PlanTransla fileScan.getTableSample().get().sampleValue, fileScan.getTableSample().get().seek)); } break; + case HUDI: + // HUDI table should be handled by visitPhysicalHudiScan, not here. + // If we reach here, it means LogicalHudiScan was incorrectly converted to + // PhysicalFileScan. + throw new RuntimeException("HUDI table should use PhysicalHudiScan instead of PhysicalFileScan. " + + "This indicates a bug in the optimizer rules. " + + "FileScan class: " + fileScan.getClass().getSimpleName()); default: throw new RuntimeException("do not support DLA type " + ((HMSExternalTable) table).getDlaType()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalHudiScan.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalHudiScan.java index c4615c6ddd07a5..be9dc632de5806 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalHudiScan.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalHudiScan.java @@ -178,6 +178,14 @@ public LogicalFileScan withOperativeSlots(Collection operativeSlots) { operativeSlots, virtualColumns, groupExpression, Optional.of(getLogicalProperties()), cachedOutputs); } + @Override + public LogicalFileScan withCachedOutput(List cachedOutputs) { + return new LogicalHudiScan(relationId, (ExternalTable) table, qualifier, + selectedPartitions, tableSample, tableSnapshot, scanParams, incrementalRelation, + operativeSlots, virtualColumns, groupExpression, Optional.of(getLogicalProperties()), + Optional.of(cachedOutputs)); + } + /** * Set scan params for incremental read *