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 ca40702530a [fix](hms) fix compatibility issue of hive metastore 
client #27327 (#27328)
ca40702530a is described below

commit ca40702530a837691c59e7fafe9651abedef8671
Author: Mingyu Chen <[email protected]>
AuthorDate: Tue Nov 21 22:42:24 2023 +0800

    [fix](hms) fix compatibility issue of hive metastore client #27327 (#27328)
---
 .../org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 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 f117b1fb129..230d4b687a4 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
@@ -342,11 +342,17 @@ public class HiveMetaStoreClient implements 
IMetaStoreClient, AutoCloseable {
 
     hiveVersion = 
HiveVersionUtil.getVersion(conf.get(HMSProperties.HIVE_VERSION));
 
-    version = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST) ? 
TEST_VERSION : VERSION;
+    // For hive 2.3.7, there is no ClientCapability.INSERT_ONLY_TABLES
+    if (hiveVersion == HiveVersion.V1_0 || hiveVersion == HiveVersion.V2_0 || 
hiveVersion == HiveVersion.V2_3) {
+      version = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST) ? 
TEST_VERSION : null;
+    } else {
+      version = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST) ? 
TEST_VERSION : VERSION;
+    }
+
     filterHook = loadFilterHooks();
     uriResolverHook = loadUriResolverHook();
     fileMetadataBatchSize = MetastoreConf.getIntVar(
-        conf, ConfVars.BATCH_RETRIEVE_OBJECTS_MAX);
+            conf, ConfVars.BATCH_RETRIEVE_OBJECTS_MAX);
 
     String msUri = MetastoreConf.getVar(conf, ConfVars.THRIFT_URIS);
     localMetaStore = MetastoreConf.isEmbeddedMetaStore(msUri);


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

Reply via email to