dengzhhu653 commented on code in PR #6943:
URL: https://github.com/apache/hive/pull/6943#discussion_r4467115125
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/impl/ColStatsStoreImpl.java:
##########
@@ -467,7 +467,7 @@ protected boolean canUseJdoQuery() throws MetaException {
@Override
protected Map<String, Map<String, String>> getJdoResult()
Review Comment:
ack, I like the `DirectSqlOnlyHelper`
##########
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:
ack
--
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]