You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by kx...@apache.org on 2024/02/18 09:53:42 UTC

(doris) branch branch-2.0 updated: [fix](iceberg) iceberg hms support hive1 (#30985) (#31052)

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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new af6145ba450 [fix](iceberg) iceberg hms support hive1 (#30985) (#31052)
af6145ba450 is described below

commit af6145ba45063934e8a5f99feba974f3d378a8f7
Author: Mingyu Chen <mo...@163.com>
AuthorDate: Sun Feb 18 17:53:34 2024 +0800

    [fix](iceberg) iceberg hms support hive1 (#30985) (#31052)
    
    Co-authored-by: wangtao <em...@foxmail.com>
---
 .../hadoop/hive/metastore/HiveMetaStoreClient.java    | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/fe/fe-core/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
index 230d4b687a4..8adad6d8bf3 100644
--- a/fe/fe-core/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
+++ b/fe/fe-core/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
@@ -1815,12 +1815,19 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable {
   @Override
   public List<Table> getTableObjectsByName(String catName, String dbName,
                                            List<String> tableNames) throws TException {
-    GetTablesRequest req = new GetTablesRequest(dbName);
-    req.setCatName(catName);
-    req.setTblNames(tableNames);
-    req.setCapabilities(version);
-    List<Table> tabs = client.get_table_objects_by_name_req(req).getTables();
-    return deepCopyTables(filterHook.filterTables(tabs));
+      List<Table> tabs = new ArrayList<>();
+      if (hiveVersion == HiveVersion.V1_0 || hiveVersion == HiveVersion.V2_0) {
+          for (String tableName: tableNames) {
+              tabs.add(client.get_table(dbName, tableName));
+          }
+      } else {
+          GetTablesRequest req = new GetTablesRequest(dbName);
+          req.setCatName(catName);
+          req.setTblNames(tableNames);
+          req.setCapabilities(version);
+          tabs = client.get_table_objects_by_name_req(req).getTables();
+      }
+      return deepCopyTables(filterHook.filterTables(tabs));
   }
 
   @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org