diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/BaseAnalysisTask.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/BaseAnalysisTask.java index 7ff30db5de8998..5b5fcdd9c7de2f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/statistics/BaseAnalysisTask.java +++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/BaseAnalysisTask.java @@ -206,7 +206,10 @@ public long getJobId() { // TODO : time cost is intolerable when column is string type, return 0 directly for now. protected String getDataSizeFunction(Column column) { - return "0"; + if (column.getType().isStringType()) { + return "SUM(LENGTH(`${colName}`))"; + } + return "COUNT(1) * " + column.getType().getSlotSize(); } protected String getSampleExpression() {