morningman commented on code in PR #28635:
URL: https://github.com/apache/doris/pull/28635#discussion_r1432358250
##########
fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsRepository.java:
##########
@@ -192,10 +193,34 @@ public static void dropStatistics(long tblId, Set<String>
colNames) throws DdlEx
public static void dropStatisticsByColName(long tblId, Set<String>
colNames, String statsTblName)
throws DdlException {
Map<String, String> params = new HashMap<>();
- String right = colNames.stream().map(s -> "'" + s +
"'").collect(Collectors.joining(","));
- String inPredicate = String.format("tbl_id = %s AND %s IN (%s)",
tblId, "col_id", right);
params.put("tblName", statsTblName);
- params.put("condition", inPredicate);
+ Iterator<String> iterator = colNames.iterator();
+ int columnCount = 0;
+ StringBuilder inPredicate = new StringBuilder();
+ while (iterator.hasNext()) {
+ inPredicate.append("'");
+ inPredicate.append(iterator.next());
+ inPredicate.append("'");
+ inPredicate.append(",");
+ columnCount++;
+ if (columnCount == Config.max_allowed_in_element_num_of_delete) {
Review Comment:
if `max_allowed_in_element_num_of_delete` is set to `0`, the check will
never succeed.
You can modify it in next PR
--
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]