maheshk114 commented on a change in pull request #2266:
URL: https://github.com/apache/hive/pull/2266#discussion_r642270082
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
##########
@@ -5394,6 +5410,476 @@ public void countOpenTxns() throws MetaException {
}
}
+ private void cleanOldStatsFromPartColStatTable(Map<PartitionInfo,
ColumnStatistics> statsPartInfoMap,
+ Connection dbConn) throws
SQLException {
+ PreparedStatement preparedStatement = null;
+ int numRows = 0;
+ int maxNumRows = MetastoreConf.getIntVar(conf,
ConfVars.DIRECT_SQL_MAX_ELEMENTS_VALUES_CLAUSE);
+
+ // Index is present on DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME. use
that.
+ // TODO : Need to add catalog name to the index
+ String delete = "DELETE FROM \"PART_COL_STATS\" where \"DB_NAME\" = ? AND "
+ + "\"TABLE_NAME\" = ? AND \"COLUMN_NAME\" = ? AND
\"PARTITION_NAME\" = ? "
+ + "AND \"PART_ID\" = ?";
+
+ try {
+ preparedStatement = sqlGenerator.prepareStmtWithParameters(dbConn,
delete, null);
Review comment:
prepareStmtWithParameters adds the quotes ..i am not sure if thats
required.
--
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]