cloud-fan commented on code in PR #36593:
URL: https://github.com/apache/spark/pull/36593#discussion_r907995124
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/expressions/aggregate/GeneralAggregateFunc.java:
##########
@@ -47,27 +47,31 @@ public final class GeneralAggregateFunc implements
AggregateFunc {
private final boolean isDistinct;
private final Expression[] children;
- public String name() { return name; }
- public boolean isDistinct() { return isDistinct; }
-
public GeneralAggregateFunc(String name, boolean isDistinct, Expression[]
children) {
this.name = name;
this.isDistinct = isDistinct;
this.children = children;
}
+ public String name() { return name; }
+ public boolean isDistinct() { return isDistinct; }
+
@Override
public Expression[] children() { return children; }
@Override
public String toString() {
- String inputsString = Arrays.stream(children)
- .map(Expression::describe)
- .collect(Collectors.joining(", "));
- if (isDistinct) {
- return name + "(DISTINCT " + inputsString + ")";
- } else {
- return name + "(" + inputsString + ")";
+ ToStringSQLBuilder builder = new ToStringSQLBuilder();
+ try {
+ return builder.build(this);
+ } catch (Throwable e) {
Review Comment:
which error do we expect to hit?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]