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

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

Github user yjshen commented on the pull request:

    https://github.com/apache/flink/pull/1916#issuecomment-213419043
  
    The type annotation work is done from bottom to top:
    
    Firstly, we know each schema of the two input, and we know `List[] 
expression` in `Project` are used to manipulate one row of table data as input 
and output one value per expression, therefore, we can infer the the output 
schema of `Project` (in the current impl this was expressed as: `def output: 
Seq[Attribute]`) if we know each expressions `dataType`. 
    
    For example, `Add`'s dataType is same as it's input, `Or`'s dataType is 
always `Boolean`, `pow(a, b)`'s dataType is always `Double`, however, if and 
only if we understand all kinds of expressions, we are able to infer its 
`dataType`. The main problems here is we only have `Call`(Unresolved Function) 
generated during expression construction, therefore, we should resolve them 
first into solid `Expression`s. `FunctionCatalog` is introduced here for a 
mapping from `FunctionName -> Expression`, we can easily finish the translation 
work as we look up `catalog`.


> Add a validation phase before construct RelNode using TableAPI
> --------------------------------------------------------------
>
>                 Key: FLINK-3754
>                 URL: https://issues.apache.org/jira/browse/FLINK-3754
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API
>    Affects Versions: 1.0.0
>            Reporter: Yijie Shen
>            Assignee: Yijie Shen
>
> Unlike sql string's execution, which have a separate validation phase before 
> RelNode construction, Table API lacks the counterparts and the validation is 
> scattered in many places.
> I suggest to add a single validation phase and detect problems as early as 
> possible.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to