You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/06/08 08:32:51 UTC
[GitHub] [hive] mszurap commented on a diff in pull request #3348: HIVE-25879: MetaStoreDirectSql test query should not query the whole DBS table
mszurap commented on code in PR #3348:
URL: https://github.com/apache/hive/pull/3348#discussion_r892075811
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java:
##########
@@ -316,17 +316,20 @@ private boolean ensureDbInit() {
}
private boolean runTestQuery() {
+ boolean doTrace = LOG.isDebugEnabled();
Transaction tx = pm.currentTransaction();
boolean doCommit = false;
if (!tx.isActive()) {
tx.begin();
doCommit = true;
}
// Run a self-test query. If it doesn't work, we will self-disable. What a PITA...
- String selfTestQuery = "select \"DB_ID\" from " + DBS + "";
+ String selfTestQuery = "select \"DB_ID\" from " + DBS + " WHERE \"DB_ID\"=1";
Review Comment:
Yes, the results do not matter at this part of the code. Actually I did not want to introduce RDBMS specific clauses like "LIMIT 0" (which is not recognized by Oracle for example), also the "WHERE 1=0" could be a valid "no-results" filter, but again, I do not know if all different DBs like that or not.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org