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

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new e68e7cba992 [fix](mtmv) Fix compensate union all wrongly when 
partition mv use partition external table (#52223)
e68e7cba992 is described below

commit e68e7cba992077ae18b548ae66e72f493126e866
Author: seawinde <[email protected]>
AuthorDate: Mon Jun 30 11:47:22 2025 +0800

    [fix](mtmv) Fix compensate union all wrongly when partition mv use 
partition external table (#52223)
    
    Fix compensate union all wrongly when partition mv use partition
    external table
    
    in test mv/external_table/part_partition_invalid.groovy
    order_qt_after_modify_data_and_refresh_catalog data should be as
    following:
    ```
    1       2       1       2023-10-17      2023-10-17
    2       2       2       2023-10-18      2023-10-18
    3       2       3       2023-10-19      2023-10-19
    ```
    
    Related PR: #49514
---
 .../doris/nereids/rules/exploration/mv/PartitionCompensator.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/PartitionCompensator.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/PartitionCompensator.java
index 0ee88ce82af..c8288ed6c8d 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/PartitionCompensator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/PartitionCompensator.java
@@ -85,8 +85,10 @@ public class PartitionCompensator {
         }
         MTMVPartitionInfo mvCustomPartitionInfo = mtmv.getMvPartitionInfo();
         BaseTableInfo relatedPartitionTable = 
mvCustomPartitionInfo.getRelatedTableInfo();
-        if (relatedPartitionTable == null || 
queryUsedBaseTablePartitionNameSet.isEmpty()) {
+        if (relatedPartitionTable == null || 
queryUsedBaseTablePartitionNameSet.isEmpty()
+                || !relatedPartitionTable.isInternalTable()) {
             // if mv is not partitioned or query not query any partition, 
doesn't compensate
+            // in 3.0, external table should not compensate union all
             return Pair.of(ImmutableMap.of(), ImmutableMap.of());
         }
         Collection<Partition> mvValidPartitions = 
cascadesContext.getStatementContext()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to