deniskuzZ commented on code in PR #4384:
URL: https://github.com/apache/hive/pull/4384#discussion_r1309810514
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java:
##########
@@ -405,6 +410,50 @@ public static List<Integer>
buildQueryWithINClauseStrings(Configuration conf, Li
return ret;
}
+ /**
+ * Executes the statement with an IN clause. If the number of elements or
the length of the constructed statement would be
+ * too big, the IN clause will be split into multiple smaller ranges, and
the statement will be executed multiple times.
+ * @param conf Hive configuration used to get the query and IN clause length
limits.
+ * @param jdbcTemplate The {@link NamedParameterJdbcTemplate} instance to
used for statement execution.
+ * @param query The query with the IN clause
+ * @param params A {@link MapSqlParameterSource} instance with the
parameters of the query
+ * @param inClauseParamName The name of the parameter representing the
content of the IN clause
+ * @param elements A {@link List} containing the elements to put in the IN
clause
+ * @param comparator A {@link Comparator} instance used to find the longest
element in the list. Used to
+ * estimate the length of the query.
+ * @return Returns the total number of affected rows.
+ * @param <T> Type of the elements in the list.
+ */
+ public static <T> int executeStatementWithInClause(Configuration conf,
NamedParameterJdbcTemplate jdbcTemplate,
Review Comment:
shouldn't this be part of util class?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]