deniskuzZ commented on code in PR #6943:
URL: https://github.com/apache/hive/pull/6943#discussion_r4466307438


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/GetHelper.java:
##########
@@ -76,16 +76,18 @@ public GetHelper(RawStoreBundle rsb,
     this.pm = rsb.getPersistentManager();
     this.allowJdo = canUseJdoQuery();
 
-    boolean isConfigEnabled = MetastoreConf.getBoolVar(baseStore.getConf(),
+    // metastore.try.direct.sql only chooses between direct SQL and JDO where 
both are available.
+    // An operation without a JDO path can only run with direct SQL, so it 
ignores the setting.
+    boolean tryDirectSql = !allowJdo || 
MetastoreConf.getBoolVar(baseStore.getConf(),
         MetastoreConf.ConfVars.TRY_DIRECT_SQL);
-    if (isConfigEnabled) {
+    if (tryDirectSql) {
       directSql = new MetaStoreDirectSql(pm, baseStore.getConf(), "");
     }
 
-    if (!allowJdo && isConfigEnabled && !directSql.isCompatibleDatastore()) {
+    if (!allowJdo && !directSql.isCompatibleDatastore()) {
       throw new MetaException("SQL is not operational"); // test path; SQL is 
enabled and broken.

Review Comment:
   should we change to
   ````
    throw new MetaException("This operation is only supported by direct SQL, 
which is not available on this datastore");
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to