platinumhamburg commented on code in PR #2307:
URL: https://github.com/apache/fluss/pull/2307#discussion_r2680690634
##########
fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/sink/FlinkTableSinkITCase.java:
##########
@@ -1221,6 +1221,136 @@ void testVersionMergeEngineWithTypeTimestampLTZ9()
throws Exception {
assertResultsIgnoreOrder(rowIter, expectedRows, true);
}
+ @Test
+ void testComprehensiveAggregationFunctions() throws Exception {
+ // Test all 11 aggregate functions (each function tested once with
representative data type)
+ tEnv.executeSql(
+ "create table comprehensive_agg ("
+ + "id int not null primary key not enforced, "
+ // Numeric aggregations
+ + "sum_int int, "
+ + "sum_double double, "
+ + "product_int int, "
+ // Max/Min aggregations (representative types: int,
double, string,
+ // timestamp)
+ + "max_int int, "
+ + "max_timestamp timestamp(3), "
+ + "min_double double, "
+ + "min_string string, "
+ // Value selection aggregations (test with/without
nulls)
+ + "first_val int, "
+ + "first_val_non_null int, "
+ + "last_val int, "
+ + "last_val_non_null int, "
+ // Boolean aggregations
+ + "bool_and_val boolean, "
+ + "bool_or_val boolean, "
+ // String aggregation with custom delimiter
+ + "listagg_val string"
+ + ") with ("
+ + "'table.merge-engine' = 'aggregation', "
+ + "'fields.sum_int.agg' = 'sum', "
+ + "'fields.sum_double.agg' = 'sum', "
+ + "'fields.product_int.agg' = 'product', "
+ + "'fields.max_int.agg' = 'max', "
+ + "'fields.max_timestamp.agg' = 'max', "
+ + "'fields.min_double.agg' = 'min', "
+ + "'fields.min_string.agg' = 'min', "
+ + "'fields.first_val.agg' = 'first_value', "
+ + "'fields.first_val_non_null.agg' =
'first_value_ignore_nulls', "
+ + "'fields.last_val.agg' = 'last_value', "
+ + "'fields.last_val_non_null.agg' =
'last_value_ignore_nulls', "
+ + "'fields.bool_and_val.agg' = 'bool_and', "
+ + "'fields.bool_or_val.agg' = 'bool_or', "
+ + "'fields.listagg_val.agg' = 'listagg', "
+ + "'fields.listagg_val.agg.params.delimiter' = '|')");
Review Comment:
I think proposal 2 is a better choice. proposal 1 has an ambiguity: when the
parent node of params is a field name, it doesn't explicitly indicate that
these are parameters for an aggregation function, which could lead to namespace
ambiguity or conflicts. I will refactor based on proposal 2.
--
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]