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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to