[fix](planner)group_concat lost order by info in second phase merge agg (#16479)
This commit is contained in:
@ -558,8 +558,10 @@ public final class AggregateInfo extends AggregateInfoBase {
|
||||
Preconditions.checkState(inputExpr.isAggregateFunction());
|
||||
Expr aggExprParam =
|
||||
new SlotRef(inputDesc.getSlots().get(i + getGroupingExprs().size()));
|
||||
FunctionCallExpr aggExpr = FunctionCallExpr.createMergeAggCall(
|
||||
inputExpr, Lists.newArrayList(aggExprParam), inputExpr.getFnParams().exprs());
|
||||
FunctionParams fnParams = inputExpr.getAggFnParams();
|
||||
FunctionCallExpr aggExpr =
|
||||
FunctionCallExpr.createMergeAggCall(inputExpr, Lists.newArrayList(aggExprParam),
|
||||
fnParams != null ? fnParams.exprs() : inputExpr.getFnParams().exprs());
|
||||
aggExpr.analyzeNoThrow(analyzer);
|
||||
// do not need analyze in merge stage, just do mark for BE get right function
|
||||
aggExpr.setOrderByElements(inputExpr.getOrderByElements());
|
||||
@ -691,6 +693,7 @@ public final class AggregateInfo extends AggregateInfoBase {
|
||||
new SlotRef(inputDesc.getSlots().get(i + getGroupingExprs().size()));
|
||||
FunctionCallExpr aggExpr = FunctionCallExpr.createMergeAggCall(
|
||||
inputExpr, Lists.newArrayList(aggExprParam), inputExpr.getFnParams().exprs());
|
||||
aggExpr.setOrderByElements(inputExpr.getOrderByElements());
|
||||
secondPhaseAggExprs.add(aggExpr);
|
||||
}
|
||||
Preconditions.checkState(
|
||||
|
||||
@ -221,6 +221,10 @@ public class FunctionCallExpr extends Expr {
|
||||
this.aggFnParams = aggFnParams;
|
||||
}
|
||||
|
||||
public FunctionParams getAggFnParams() {
|
||||
return aggFnParams;
|
||||
}
|
||||
|
||||
public void setIsAnalyticFnCall(boolean v) {
|
||||
isAnalyticFnCall = v;
|
||||
}
|
||||
|
||||
@ -41,8 +41,6 @@ public class GroupConcat extends NullableAggregateFunction
|
||||
|
||||
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
|
||||
FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(VarcharType.SYSTEM_DEFAULT),
|
||||
FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT)
|
||||
.args(VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT),
|
||||
FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT)
|
||||
.varArgs(VarcharType.SYSTEM_DEFAULT, AnyDataType.INSTANCE),
|
||||
FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT)
|
||||
|
||||
Reference in New Issue
Block a user