twalthr commented on a change in pull request #18858:
URL: https://github.com/apache/flink/pull/18858#discussion_r811260285



##########
File path: 
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/bridging/BridgingSqlAggFunction.java
##########
@@ -117,6 +116,22 @@ public static BridgingSqlAggFunction of(
                 dataTypeFactory, typeFactory, kind, resolvedFunction, 
typeInference);
     }
 
+    /** Creates an instance of a aggregate function during translation. */
+    public static BridgingSqlAggFunction of(
+            FlinkContext context,
+            FlinkTypeFactory typeFactory,
+            ContextResolvedFunction resolvedFunction) {
+        final DataTypeFactory dataTypeFactory = 
context.getCatalogManager().getDataTypeFactory();

Review comment:
       Yes, this might be personal preference. Local variable help in breaking 
a problem into subproblems. I find this makes the code much more readable and 
no IDE shows you a warning for this. Not everything that can be inlined should 
be inlined if you can give it a nice variable name.




-- 
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]


Reply via email to