Repository: hive Updated Branches: refs/heads/master 236a32c64 -> 611770ddf
HIVE-20443 : txn stats cleanup in compaction txn handler is unneeded (Sergey Shelukhin, reviewed by Eugene Koifman) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/5c3ed065 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/5c3ed065 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/5c3ed065 Branch: refs/heads/master Commit: 5c3ed065ab2636618548e9461a6e5d74c83c79f8 Parents: 236a32c Author: sergey <ser...@apache.org> Authored: Thu Aug 23 12:11:37 2018 -0700 Committer: sergey <ser...@apache.org> Committed: Thu Aug 23 12:11:37 2018 -0700 ---------------------------------------------------------------------- .../metastore/txn/CompactionTxnHandler.java | 52 +------------------- 1 file changed, 2 insertions(+), 50 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/5c3ed065/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java index 1f559e9..cbb76d5 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java @@ -328,7 +328,7 @@ class CompactionTxnHandler extends TxnHandler { /** * This will remove an entry from the queue after * it has been compacted. - * + * * @param info info on the compaction entry to remove */ @Override @@ -593,54 +593,6 @@ class CompactionTxnHandler extends TxnHandler { StringBuilder prefix = new StringBuilder(); StringBuilder suffix = new StringBuilder(); - // Turn off COLUMN_STATS_ACCURATE for txnids' components in TBLS and PARTITIONS - prefix.append("select tbl_id from TBLS inner join DBS on TBLS.DB_ID = DBS.DB_ID " - + "inner join TXN_TO_WRITE_ID on t2w_database = DBS.NAME and t2w_table = TBLS.TBL_NAME" - + " and t2w_writeid = TBLS.WRITE_ID where "); - suffix.append(""); - TxnUtils.buildQueryWithINClause(conf, queries, prefix, suffix, txnids, "t2w_txnid", true, false); - - // Delete COLUMN_STATS_ACCURATE.BASIC_STATS rows from TABLE_PARAMS for the txnids. - List<StringBuilder> finalCommands = new ArrayList<>(queries.size()); - for (int i = 0; i < queries.size(); i++) { - String query = queries.get(i); - finalCommands.add(i, new StringBuilder("delete from TABLE_PARAMS " + - " where param_key = '" + "COLUMN_STATS_ACCURATE" + "' and tbl_id in (")); - finalCommands.get(i).append(query + ")"); - LOG.debug("Going to execute update <" + finalCommands.get(i) + ">"); - int rc = stmt.executeUpdate(finalCommands.get(i).toString()); - LOG.info("Turned off " + rc + " COLUMN_STATE_ACCURATE.BASIC_STATS states from TBLS"); - } - - queries.clear(); - prefix.setLength(0); - suffix.setLength(0); - finalCommands.clear(); - - // Delete COLUMN_STATS_ACCURATE.BASIC_STATS rows from PARTITIONS_PARAMS for the txnids. - prefix.append("select part_id from PARTITIONS " - + "inner join TBLS on PARTITIONS.TBL_ID = TBLS.TBL_ID " - + "inner join DBS on TBLS.DB_ID = DBS.DB_ID " - + "inner join TXN_TO_WRITE_ID on t2w_database = DBS.NAME and t2w_table = TBLS.TBL_NAME" - + " and t2w_writeid = TBLS.WRITE_ID where "); - suffix.append(""); - TxnUtils.buildQueryWithINClause(conf, queries, prefix, suffix, txnids, "t2w_txnid", true, false); - - for (int i = 0; i < queries.size(); i++) { - String query = queries.get(i); - finalCommands.add(i, new StringBuilder("delete from PARTITION_PARAMS " + - " where param_key = '" + "COLUMN_STATS_ACCURATE" + "' and part_id in (")); - finalCommands.get(i).append(query + ")"); - LOG.debug("Going to execute update <" + finalCommands.get(i) + ">"); - int rc = stmt.executeUpdate(finalCommands.get(i).toString()); - LOG.info("Turned off " + rc + " COLUMN_STATE_ACCURATE.BASIC_STATS states from PARTITIONS"); - } - - queries.clear(); - prefix.setLength(0); - suffix.setLength(0); - finalCommands.clear(); - // Delete from TXNS. prefix.append("delete from TXNS where "); suffix.append(""); @@ -993,7 +945,7 @@ class CompactionTxnHandler extends TxnHandler { * User initiated compactions don't do this check. * * Do we allow compacting whole table (when it's partitioned)? No, though perhaps we should. - * That would be a meta operations, i.e. first find all partitions for this table (which have + * That would be a meta operations, i.e. first find all partitions for this table (which have * txn info) and schedule each compaction separately. This avoids complications in this logic. */ @Override