deniskuzZ commented on a change in pull request #1688:
URL: https://github.com/apache/hive/pull/1688#discussion_r530238192
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnDbUtil.java
##########
@@ -232,15 +232,23 @@ public static void cleanDb(Configuration conf) throws
Exception {
success &= truncateTable(conn, conf, stmt, "WRITE_SET");
success &= truncateTable(conn, conf, stmt, "REPL_TXN_MAP");
success &= truncateTable(conn, conf, stmt,
"MATERIALIZATION_REBUILD_LOCKS");
+ success &= truncateTable(conn, conf, stmt, "MIN_HISTORY_LEVEL");
try {
- resetTxnSequence(conn, conf, stmt);
- stmt.executeUpdate("INSERT INTO \"NEXT_LOCK_ID\" VALUES(1)");
- stmt.executeUpdate("INSERT INTO \"NEXT_COMPACTION_QUEUE_ID\"
VALUES(1)");
- } catch (SQLException e) {
- if (!getTableNotExistsErrorCodes().contains(e.getSQLState())) {
- LOG.error("Error initializing sequence values", e);
- success = false;
+ String dbProduct = conn.getMetaData().getDatabaseProductName();
+ DatabaseProduct databaseProduct = determineDatabaseProduct(dbProduct,
conf);
+ try {
+ resetTxnSequence(databaseProduct, stmt);
+ stmt.executeUpdate("INSERT INTO \"NEXT_LOCK_ID\" VALUES(1)");
+ stmt.executeUpdate("INSERT INTO \"NEXT_COMPACTION_QUEUE_ID\"
VALUES(1)");
+ } catch (SQLException e) {
+ if (!databaseProduct.isTableNotExists(e)) {
Review comment:
Previous version was much more readable and concise.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]