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

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


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new a6b97c14d24 branch-3.1: [opt](explain) use full qualified name in scan 
node #52342 (#52707)
a6b97c14d24 is described below

commit a6b97c14d246c99e94438253b5c037e3bc31b44f
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Fri Jul 4 10:40:18 2025 +0800

    branch-3.1: [opt](explain) use full qualified name in scan node #52342 
(#52707)
    
    bp #52342
---
 .../java/org/apache/doris/catalog/TableIf.java     | 13 +++++--
 .../org/apache/doris/datasource/FileScanNode.java  |  2 +-
 .../iceberg/test_iceberg_filter.groovy             |  1 +
 .../external_table_p0/tvf/test_tvf_view.groovy     | 15 +++++++-
 .../tvf/test_tvf_view_count.groovy                 | 42 ----------------------
 5 files changed, 26 insertions(+), 47 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/TableIf.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/TableIf.java
index 7d95d959ba6..1ca51e2d394 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/TableIf.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/TableIf.java
@@ -480,9 +480,15 @@ public interface TableIf {
     }
 
     default String getNameWithFullQualifiers() {
-        return String.format("%s.%s.%s", getDatabase().getCatalog().getName(),
-                
ClusterNamespace.getNameFromFullName(getDatabase().getFullName()),
-                getName());
+        DatabaseIf db = getDatabase();
+        // Some kind of table like FunctionGenTable does not belong to any 
database
+        if (db == null) {
+            return "null.null." + getName();
+        } else {
+            return db.getCatalog().getName()
+                    + "." + 
ClusterNamespace.getNameFromFullName(db.getFullName())
+                    + "." + getName();
+        }
     }
 
     default boolean isManagedTable() {
@@ -560,3 +566,4 @@ public interface TableIf {
         return false;
     }
 }
+
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/FileScanNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/FileScanNode.java
index d2c6230ba6b..43b9f8617d6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/FileScanNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/FileScanNode.java
@@ -95,7 +95,7 @@ public abstract class FileScanNode extends ExternalScanNode {
     @Override
     public String getNodeExplainString(String prefix, TExplainLevel 
detailLevel) {
         StringBuilder output = new StringBuilder();
-        output.append(prefix).append("table: 
").append(desc.getTable().getName()).append("\n");
+        output.append(prefix).append("table: 
").append(desc.getTable().getNameWithFullQualifiers()).append("\n");
         if (!conjuncts.isEmpty()) {
             output.append(prefix).append("predicates: 
").append(getExplainString(conjuncts)).append("\n");
         }
diff --git 
a/regression-test/suites/external_table_p0/iceberg/test_iceberg_filter.groovy 
b/regression-test/suites/external_table_p0/iceberg/test_iceberg_filter.groovy
index 94d753cc986..211aa933f80 100644
--- 
a/regression-test/suites/external_table_p0/iceberg/test_iceberg_filter.groovy
+++ 
b/regression-test/suites/external_table_p0/iceberg/test_iceberg_filter.groovy
@@ -65,6 +65,7 @@ suite("test_iceberg_filter", 
"p0,external,doris,external_docker,external_docker_
             explain {
                 sql("select * from ${tb_ts_filter} where ts < '2024-05-30 
20:34:56'")
                 contains "inputSplitNum=0"
+                contains "table: 
test_iceberg_filter.multi_catalog.tb_ts_filter"
             }
             explain {
                 sql("select * from ${tb_ts_filter} where ts < '2024-05-30 
20:34:56.12'")
diff --git a/regression-test/suites/external_table_p0/tvf/test_tvf_view.groovy 
b/regression-test/suites/external_table_p0/tvf/test_tvf_view.groovy
index 25f70961074..0a59397bab4 100644
--- a/regression-test/suites/external_table_p0/tvf/test_tvf_view.groovy
+++ b/regression-test/suites/external_table_p0/tvf/test_tvf_view.groovy
@@ -44,6 +44,7 @@ suite("test_tvf_view", 
"p0,external,tvf,external_docker,hive") {
             contains("_table_valued_function_hdfs.p_container")
             contains("_table_valued_function_hdfs.p_retailprice")
             contains("_table_valued_function_hdfs.p_comment")
+            contains("table: null.null.HDFSTableValuedFunction")
         }
         explain{
             sql("select * from hdfs (\n" +
@@ -61,7 +62,19 @@ suite("test_tvf_view", 
"p0,external,tvf,external_docker,hive") {
             contains("_table_valued_function_hdfs.p_comment")
         }
 
-        sql """drop database if exists test_tvf_view_p2"""
+        sql """create view tvf_view_count as select * from hdfs (
+            
"uri"="hdfs://${nameNodeHost}:${hdfsPort}/user/doris/tpch1.db/tpch1_parquet/part/part-00000-cb9099f7-a053-4f9a-80af-c659cfa947cc-c000.snappy.parquet",
+            "hadoop.username" = "hadoop",
+            "format"="parquet");"""
+
+        explain {
+            verbose true
+            sql("select count(1) from tvf_view_count")
+            contains "SlotDescriptor{id=0,"
+            notContains "SlotDescriptor{id=1,"
+        }
+
+        // sql """drop database if exists test_tvf_view_p2"""
     }
 }
 
diff --git 
a/regression-test/suites/external_table_p0/tvf/test_tvf_view_count.groovy 
b/regression-test/suites/external_table_p0/tvf/test_tvf_view_count.groovy
deleted file mode 100644
index d0d6d80fd5e..00000000000
--- a/regression-test/suites/external_table_p0/tvf/test_tvf_view_count.groovy
+++ /dev/null
@@ -1,42 +0,0 @@
-// 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.
-
-suite("test_tvf_view_count", "p0,external,tvf,external_docker,hive") {
-    String enabled = context.config.otherConfigs.get("enableHiveTest")
-    if (enabled != null && enabled.equalsIgnoreCase("true")) {
-        String nameNodeHost = context.config.otherConfigs.get("externalEnvIp")
-        String hdfsPort = context.config.otherConfigs.get("hive2HdfsPort")
-
-        sql """drop database if exists test_tvf_view_count_p2"""
-        sql """create database test_tvf_view_count_p2"""
-        sql """use test_tvf_view_count_p2"""
-        sql """create view tvf_view_count as select * from hdfs (
-            
"uri"="hdfs://${nameNodeHost}:${hdfsPort}/user/doris/tpch1.db/tpch1_parquet/part/part-00000-cb9099f7-a053-4f9a-80af-c659cfa947cc-c000.snappy.parquet",
-            "hadoop.username" = "hadoop",
-            "format"="parquet");"""
-
-        explain {
-            verbose true
-            sql("select count(1) from tvf_view_count")
-            contains "SlotDescriptor{id=0,"
-            notContains "SlotDescriptor{id=1,"
-        }
-
-        sql """drop database if exists test_tvf_view_count_p2"""
-    }
-}
-


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

Reply via email to