Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
Signed-off-by: shuming.li <[email protected]>
  • Loading branch information
LiShuMing committed Aug 22, 2024
1 parent cf62520 commit eff5edd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6478,7 +6478,8 @@ public ParseNode visitAggregationFunctionCall(StarRocksParser.AggregationFunctio
}

// GROUP_CONCAT: use higher version of group_concat if there is order by or distinct clause
if (isGroupConcat && (isDistinct || !CollectionUtils.isEmpty(orderByElements))) {
if (isGroupConcat && (isDistinct || !CollectionUtils.isEmpty(orderByElements)
|| context.aggregationFunction().SEPARATOR() != null)) {
functionName = FunctionSet.GROUP_CONCAT_V2;
if (!exprs.isEmpty() && context.aggregationFunction().SEPARATOR() == null) {
Expr sepExpr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ public void testOneTabletDistinctAgg() throws Exception {
String sql = "select sum(id), group_concat(distinct name) from skew_table where id = 1 group by id";
String plan = getFragmentPlan(sql);
assertContains(plan, "2:AGGREGATE (update finalize)\n" +
" | output: sum(3: sum), group_concat(2: name, ',')\n" +
" | output: sum(3: sum), group_concat2(2: name, ',')\n" +
" | group by: 1: id\n" +
" | \n" +
" 1:AGGREGATE (update serialize)\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void testBitmapQuery() throws Exception {
"PREAGGREGATION: OFF. Reason: Aggregate Operator not match: COUNT <--> BITMAP_UNION");

starRocksAssert.query("select group_concat(id2) from test.bitmap_table;")
.analysisError("No matching function with signature: group_concat(bitmap");
.analysisError("group_concat requires first parameter to be of getType() STRING");

starRocksAssert.query("select sum(id2) from test.bitmap_table;").analysisError(
"No matching function with signature: sum(bitmap).");
Expand Down Expand Up @@ -61,7 +61,7 @@ public void testHLLTypeQuery() throws Exception {
"PREAGGREGATION: OFF. Reason: Aggregate Operator not match: COUNT <--> HLL_UNION");

starRocksAssert.query("select group_concat(id2) from test.hll_table;")
.analysisError("No matching function with signature: group_concat(hll");
.analysisError("group_concat requires first parameter to be of getType() STRING");

starRocksAssert.query("select sum(id2) from test.hll_table;")
.analysisError("No matching function with signature: sum(hll).");
Expand Down

0 comments on commit eff5edd

Please sign in to comment.