Kikyou1997 commented on code in PR #18971: URL: https://github.com/apache/doris/pull/18971#discussion_r1176170741
########## fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsRepository.java: ########## @@ -173,14 +179,22 @@ private static String constructId(Object... params) { } public static void dropStatistics(long tblId, Set<String> colNames) throws DdlException { - dropStatistics(tblId, colNames, StatisticConstants.STATISTIC_TBL_NAME); - dropStatistics(tblId, colNames, StatisticConstants.HISTOGRAM_TBL_NAME); + dropStatistics(tblId, Collections.emptySet(), colNames, StatisticConstants.STATISTIC_TBL_NAME); + dropStatistics(tblId, Collections.emptySet(), colNames, StatisticConstants.HISTOGRAM_TBL_NAME); } - public static void dropStatistics(long tblId, Set<String> colNames, String statsTblName) throws DdlException { + public static void dropStatistics(long tblId, Set<Long> partNames, 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); + String inPredicate = String.format("tbl_id = %s", tblId); + if (!colNames.isEmpty()) { + String right = StatisticsUtil.joinElementsToString(colNames, "', '"); + inPredicate += String.format(" AND col_id IN ('%s')", right); Review Comment: Since part_id is unique, do we need col_id and tbl_id as condition? -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org