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

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

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3623#discussion_r110381407
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/schema/DeferredTypeFlinkTableFunction.scala
 ---
    @@ -40,6 +43,10 @@ class DeferredTypeFlinkTableFunction(
         val implicitResultType: TypeInformation[_])
       extends FlinkTableFunction(tableFunction, evalMethod) {
     
    +  val paramTypeInfos = evalMethod.getParameterTypes.map { paramType =>
    +    TypeExtractor.getForClass(paramType)
    --- End diff --
    
    I noticed that the semantics of how the type lists are obtained are a bit 
different in both cases. In `UserDefinedFunctionUtils` we look at the 
parameters that are handed to the function. Here we look at the signature of 
the `eval` method. The result will be different if the `eval` method is called 
with more specific types than its signature has, e.g., if we have `eval(Object 
o1, Object o2)` and call it with `eval(new Integer(1), new String("Hello"))`. 
    
    Both approaches make sense:
    1. parameter types are more specific
    2. with signature types it is easier to identify which eval() method is 
called.
    
    What do you think @clarkyzl, @KurtYoung?


> Support dynamic schema in Table Function
> ----------------------------------------
>
>                 Key: FLINK-6196
>                 URL: https://issues.apache.org/jira/browse/FLINK-6196
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Zhuoluo Yang
>            Assignee: Zhuoluo Yang
>
> In many of our use cases. We have to decide the schema of a UDTF at the run 
> time. For example. udtf('c1, c2, c3') will generate three columns for a 
> lateral view. 
> Most systems such as calcite and hive support this feature. However, the 
> current implementation of flink didn't implement the feature correctly.



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

Reply via email to