dianfu commented on code in PR #21332:
URL: https://github.com/apache/flink/pull/21332#discussion_r1030214339


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/python/PythonAggregateFunction.java:
##########
@@ -120,6 +163,15 @@ public TypeInference getTypeInference(DataTypeFactory 
typeFactory) {
         if (inputTypes != null) {
             builder.typedArguments(inputTypes);
         }
+
+        if (resultType == null) {

Review Comment:
   What about moving this to the constructor?



##########
flink-python/pyflink/table/udf.py:
##########
@@ -516,8 +539,14 @@ def _create_judf(self, serialized_func, j_input_types, 
j_function_kind):
             gateway = get_gateway()
             j_input_types = java_utils.to_jarray(
                 gateway.jvm.DataType, [_to_java_data_type(i) for i in 
self._input_types])

Review Comment:
   `line 536: self._accumulator_type = DataTypes.ARRAY(self._result_type)`
   What happens if self._result_type is a string?



##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/python/PythonTableAggregateFunction.java:
##########
@@ -120,6 +163,15 @@ public TypeInference getTypeInference(DataTypeFactory 
typeFactory) {
         if (inputTypes != null) {
             builder.typedArguments(inputTypes);
         }
+

Review Comment:
   `line 152: TypeConversions.fromDataTypeToLegacyInfo(resultType)`
   
   Does it still work?



##########
flink-python/pyflink/table/udf.py:
##########
@@ -516,8 +539,14 @@ def _create_judf(self, serialized_func, j_input_types, 
j_function_kind):
             gateway = get_gateway()
             j_input_types = java_utils.to_jarray(
                 gateway.jvm.DataType, [_to_java_data_type(i) for i in 
self._input_types])

Review Comment:
   Will we support specifying input types via string?



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