wuchong commented on code in PR #2307:
URL: https://github.com/apache/fluss/pull/2307#discussion_r2702206617
##########
fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/utils/FlinkAggFunctionParser.java:
##########
@@ -88,19 +86,19 @@ public static Optional<AggFunction> parseAggFunction(String
columnName, Configur
*
* <pre>
* fields.<column>.agg = <function_name>
- * fields.<column>.agg.params.<param> = <value>
+ * fields.<column>.<function_name>.<param> =
<value>
* </pre>
*/
public static void formatAggFunctionToOptions(
String columnName, AggFunction aggFunction, Map<String, String>
options) {
// Set function name
String funcKey = AGG_PREFIX + columnName + AGG_SUFFIX;
- options.put(funcKey, aggFunction.getType().toString());
+ String funcName = aggFunction.getType().toString();
+ options.put(funcKey, funcName);
- // Set parameters
+ // Set parameters: fields.<column>.<function_name>.<param>
for (Map.Entry<String, String> param :
aggFunction.getParameters().entrySet()) {
- String paramKey =
- AGG_PREFIX + columnName + AGG_SUFFIX + PARAMS_SUFFIX + "."
+ param.getKey();
+ String paramKey = AGG_PREFIX + columnName + "." + funcName + "." +
param.getKey();
Review Comment:
The function name value might be in uppercase, so we should convert it to
lowercase to ensure the option key is always in lowercase.
--
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]