From 4f35d30fff063a53068533d33bb515bf2f2c33ac Mon Sep 17 00:00:00 2001 From: morningman Date: Tue, 24 Sep 2024 18:54:37 +0800 Subject: [PATCH] 1 --- .../src/main/java/org/apache/doris/catalog/Table.java | 6 ------ .../src/main/java/org/apache/doris/catalog/TableIf.java | 4 ++++ .../org/apache/doris/datasource/hive/HMSExternalTable.java | 6 ++++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Table.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Table.java index 8cfe52356cf230..862d6c1878e026 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Table.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Table.java @@ -500,12 +500,6 @@ public void readFields(DataInput in) throws IOException { this.createTime = in.readLong(); } - // return if this table is partitioned. - // For OlapTable, return true only if its partition type is RANGE or HASH - public boolean isPartitionedTable() { - return false; - } - // return if this table is partitioned, for planner. // For OlapTable ture when is partitioned, or distributed by hash when no partition public boolean isPartitionDistributed() { 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 be8f1fe6f94b4b..1c03dad4883a98 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 @@ -556,4 +556,8 @@ default boolean isPartitionColumn(String columnName) { default Set getDistributionColumnNames() { return Sets.newHashSet(); } + + default boolean isPartitionedTable() { + return false; + } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java index 52070953279270..7371f9766c02b5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java @@ -920,4 +920,10 @@ private List getFilesForPartitions( String bindBrokerName = catalog.bindBrokerName(); return cache.getFilesByPartitionsWithoutCache(hivePartitions, bindBrokerName); } + + @Override + public boolean isPartitionedTable() { + makeSureInitialized(); + return remoteTable.getPartitionKeysSize() > 0; + } }