[
https://issues.apache.org/jira/browse/HIVE-25115?focusedWorklogId=600545&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-600545
]
ASF GitHub Bot logged work on HIVE-25115:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 21/May/21 17:47
Start Date: 21/May/21 17:47
Worklog Time Spent: 10m
Work Description: belugabehr commented on a change in pull request #2274:
URL: https://github.com/apache/hive/pull/2274#discussion_r637098961
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java
##########
@@ -383,6 +384,37 @@ public static String getFullTableName(String dbName,
String tableName) {
return ret;
}
+ /**
+ * Executes simple update queries based on output from
TxnUtils#buildQueryWithINClauseStrings.
+ * Example: desired queries are "delete from x where y in (1, 2, 3)" and
"delete from x where y in (4, 5, 6)"
+ *
+ * @param updateQueries List of: "delete from x where y in (?,?,?)",
"delete from x where y in (?,?,?)"
+ * @param updateQueryCount Number of queries to execute, in the example: 2
+ * @param ids to prepare statement with. In the example: List containing: 1,
2, 3, 4, 5, 6
+ * @param dbConn database Connection
+ * @throws SQLException
+ */
+ public static int executeUpdateQueries(List<String> updateQueries,
List<Integer> updateQueryCount, List<Long> ids,
+ Connection dbConn)
+ throws SQLException {
+ int totalCount = 0;
+ int updatedCount = 0;
+ for (int i = 0; i < updateQueries.size(); i++) {
+ String query = updateQueries.get(i);
+ long insertCount = updateQueryCount.get(i);
+ LOG.debug("Going to execute update <" + query + ">");
+ PreparedStatement pStmt = dbConn.prepareStatement(query);
+ for (int j = 0; j < insertCount; j++) {
+ pStmt.setLong(j + 1, ids.get(totalCount + j));
+ }
+ totalCount += insertCount;
+ int count = pStmt.executeUpdate();
+ LOG.debug("Updated " + count + " records");
Review comment:
Use anchors.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 600545)
Time Spent: 1h 10m (was: 1h)
> Compaction queue entries may accumulate in "ready for cleaning" state
> ---------------------------------------------------------------------
>
> Key: HIVE-25115
> URL: https://issues.apache.org/jira/browse/HIVE-25115
> Project: Hive
> Issue Type: Improvement
> Reporter: Karen Coppage
> Assignee: Karen Coppage
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> If the Cleaner does not delete any files, the compaction queue entry is
> thrown back to the queue and remains in "ready for cleaning" state.
> Problem: If 2 compactions run on the same table and enter "ready for
> cleaning" state at the same time, only one "cleaning" will remove obsolete
> files, the other entry will remain in the queue in "ready for cleaning" state.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)