weizhengte commented on code in PR #17966:
URL: https://github.com/apache/doris/pull/17966#discussion_r1144355799


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/HistogramTask.java:
##########
@@ -48,7 +49,16 @@ public class HistogramTask extends BaseAnalysisTask {
             + "    HISTOGRAM(`${colName}`, 1, ${maxBucketNum}) AS buckets, "
             + "    NOW() AS create_time "
             + "FROM "
-            + "    `${dbName}`.`${tblName}` TABLESAMPLE (${percentValue} 
PERCENT)";
+            + "    `${dbName}`.`${tblName}`";
+
+    /** To avoid too much data, use the following efficient sampling method */
+    private static final String ANALYZE_HISTOGRAM_SQL_TEMPLATE_PART = 
ANALYZE_HISTOGRAM_SQL_TEMPLATE
+            + "    PARTITION (${partName})"
+            + "    TABLESAMPLE (${percentValue} PERCENT)";
+
+    /** To avoid too much data, use the following efficient sampling method */
+    private static final String ANALYZE_HISTOGRAM_SQL_TEMPLATE_FULL = 
ANALYZE_HISTOGRAM_SQL_TEMPLATE

Review Comment:
   yeah, this should be in the sample task(Next pr)



##########
fe/fe-core/src/main/java/org/apache/doris/statistics/MVAnalysisTask.java:
##########
@@ -111,7 +110,7 @@ public void execute() throws Exception {
                 params.put("idxId", String.valueOf(meta.getIndexId()));
                 String colName = column.getName();
                 params.put("colId", colName);
-                long partId = part.getId();
+                long partId = olapTable.getPartition(partName).getId();

Review Comment:
   Fixed



-- 
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

Reply via email to