From 5130528a5c7d73552be06aec4ac0f072df9d745d Mon Sep 17 00:00:00 2001 From: AKIRA <33112463+Kikyou1997@users.noreply.github.com> Date: Thu, 17 Aug 2023 16:09:18 +0800 Subject: [PATCH] [fix](stats) Add logic for data size calculation (#23103) --- .../java/org/apache/doris/statistics/BaseAnalysisTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() {