wuchong commented on a change in pull request #9316: [FLINK-13529][table-planner-blink] Verify and correct agg function's semantic for Blink planner URL: https://github.com/apache/flink/pull/9316#discussion_r310386025
########## File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/functions/sql/SqlListAggFunction.java ########## @@ -27,27 +27,30 @@ import org.apache.calcite.sql.SqlKind; import org.apache.calcite.sql.type.OperandTypes; import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlTypeFamily; import org.apache.calcite.sql.type.SqlTypeName; import org.apache.calcite.sql.type.SqlTypeTransforms; import java.util.List; /** - * <code>CONCAT_AGG</code> aggregate function returns the concatenation of + * <code>LISTAGG</code> aggregate function returns the concatenation of * a list of values that are input to the function. */ -public class SqlConcatAggFunction extends SqlAggFunction { +public class SqlListAggFunction extends SqlAggFunction { - public SqlConcatAggFunction() { - super("CONCAT_AGG", + public SqlListAggFunction() { + super("LISTAGG", null, SqlKind.OTHER_FUNCTION, ReturnTypes.cascade(ReturnTypes.explicit(SqlTypeName.VARCHAR), SqlTypeTransforms.TO_NULLABLE), null, OperandTypes.or( OperandTypes.CHARACTER, - OperandTypes.family(SqlTypeFamily.CHARACTER, SqlTypeFamily.CHARACTER)), + OperandTypes.sequence( + "'(DATA, SEPARATOR)'", + OperandTypes.CHARACTER, + OperandTypes.and(OperandTypes.CHARACTER, OperandTypes.NULLABLE_LITERAL) Review comment: Do we need to support null literal? Considering all aggregate function ignores null arguments, I would like to us `OperandTypes.LITERAL` here. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services