github-actions[bot] commented on code in PR #62435:
URL: https://github.com/apache/doris/pull/62435#discussion_r3108227722
##########
fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java:
##########
@@ -328,7 +328,11 @@ protected void doFull() throws Exception {
if (StatisticsUtil.enablePartitionAnalyze() &&
tbl.isPartitionedTable()) {
doPartitionTable();
Review Comment:
`doFull()` still routes partitioned tables into `doPartitionTable()` when
`enable_partition_analyze=true`, and that path eventually merges partition
stats with `MERGE_PARTITION_TEMPLATE`, which still hardcodes `null as
hot_value`. So the new full-analyze collection only works for non-partitioned
OLAP tables; partitioned tables will keep publishing `null` hot values even
though the PR/body says full analyze now matches sample analyze.
##########
fe/fe-core/src/main/java/org/apache/doris/statistics/ExternalAnalysisTask.java:
##########
@@ -59,9 +60,10 @@ protected void deleteNotExistPartitionStats(AnalysisInfo
jobInfo) throws DdlExce
protected void doFull() throws Exception {
StringBuilder sb = new StringBuilder();
Map<String, String> params = buildSqlParams();
- params.put("min", getMinFunction());
- params.put("max", getMaxFunction());
params.put("dataSizeFunction", getDataSizeFunction(col, false));
Review Comment:
This only fixes the SQL-based external full-analyze path. Ordinary HMS
analyze still defaults to `HMSAnalysisTask#doExecute()`'s metadata path unless
the user explicitly sets `USING SQL`, and that path still builds stats through
`ANALYZE_PARTITION_COLUMN_TEMPLATE`/`getHmsColumnStats()` without any
`hot_value`. In other words, default HMS full analyze will still return `null`
hot values after this PR.
##########
regression-test/suites/statistics/test_hot_value.groovy:
##########
@@ -81,28 +81,31 @@ suite("test_hot_value") {
wait_row_count_reported("test_hot_value", "test1", 0, 4, "10000")
wait_row_count_reported("test_hot_value", "test2", 0, 4, "10000")
sql """analyze table test1 with sync"""
- logger.info("1. memo plan ")
- explain {
- sql("memo plan select * from test1")
- contains "hotValues=(null)"
- }
def result = sql """show column stats test1(key1)"""
assertEquals(1, result.size())
assertEquals("10000.0", result[0][2])
- assertEquals("null", result[0][17])
+ assertTrue(result[0][17] != "null")
result = sql """show column stats test1(value1)"""
logger.info("0. result " + result)
assertEquals(1, result.size())
assertEquals("10000.0", result[0][2])
- assertEquals("null", result[0][17])
+ String[] fullHotValues = result[0][17].split(";")
Review Comment:
These assertions only check the stored stats row. The previous `memo plan`
check for the full-analyze path was removed, so the suite no longer verifies
that the newly collected `hot_value` actually reaches optimizer state. Could we
keep/add an `explain` assertion here so this stays end-to-end instead of just
checking the stats table contents?
--
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]