[ 
https://issues.apache.org/jira/browse/FLINK-5906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995044#comment-15995044
 ] 

ASF GitHub Bot commented on FLINK-5906:
---------------------------------------

Github user shaoxuan-wang commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3809#discussion_r114571910
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/ProjectionTranslator.scala
 ---
    @@ -327,4 +332,56 @@ object ProjectionTranslator {
           }
       }
     
    +  /**
    +    * Find and replace UDAGG function Call to UDAGGFunctionCall
    +    *
    +    * @param field    the expression to check
    +    * @param tableEnv the TableEnvironment
    +    * @return an expression with correct UDAGGFunctionCall type for UDAGG 
functions
    +    */
    +  def replaceUDAGGFunctionCall(field: Expression, tableEnv: 
TableEnvironment): Expression = {
    --- End diff --
    
    We will not have the chance to execute LogicalNode#resolveExpressions 
before get aggNames, projectFields, etc. I actually tried another alternative 
approach to conduct the replacement in extractAggregationsAndProperties and 
replaceAggregationsAndProperties (we have to check and handle the UDAGG call 
carefully in both functions), it works but I do not like that design. It makes 
the logic of these two methods not completely clean. Also, in over aggregate it 
will not call extractAggregationsAndProperties and 
replaceAggregationsAndProperties. So I decide to implement a separate function 
to handle the UDAGGFunctionCall replacement.


> Add support to register UDAGG in Table and SQL API
> --------------------------------------------------
>
>                 Key: FLINK-5906
>                 URL: https://issues.apache.org/jira/browse/FLINK-5906
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: Fabian Hueske
>            Assignee: Shaoxuan Wang
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to