[ https://issues.apache.org/jira/browse/FLINK-6740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16027732#comment-16027732 ]
sunjincheng commented on FLINK-6740: ------------------------------------ I think this JIRA. is not very important for release 1.3. And the JIRA of [FLINK-6672|https://issues.apache.org/jira/browse/FLINK-6672] can also deal with this problem. So close this JIRA. > Fix "parameterTypeEquals" method error. > --------------------------------------- > > Key: FLINK-6740 > URL: https://issues.apache.org/jira/browse/FLINK-6740 > Project: Flink > Issue Type: Sub-task > Components: Table API & SQL > Affects Versions: 1.3.0 > Reporter: sunjincheng > Assignee: sunjincheng > > When we define UDTF as follows: > {code} > class TableFuncPojo extends TableFunction[TPojo] { > def eval(age: Int, name:String): Unit = { > collect(new TPojo(age.toLong,name)) > } > def eval(age: Date, name:String): Unit = { > collect(new > TPojo(org.apache.calcite.runtime.SqlFunctions.toInt(age).toLong,name)) > } > } > {code} > TableAPI: > {code} > val table = stream.toTable(tEnv, > 'long2, 'int, 'double, 'float, 'bigdec, 'ts, 'date,'pojo, 'string, > 'long.rowtime) > val windowedTable = table > .join(udtf('date, 'string) as 'pojo2).select('pojo2) > {code} > We will get the error as following: > {code} > org.apache.flink.table.api.ValidationException: Found multiple 'eval' methods > which match the signature. > at > org.apache.flink.table.functions.utils.UserDefinedFunctionUtils$.getUserDefinedMethod(UserDefinedFunctionUtils.scala:180) > at > org.apache.flink.table.plan.logical.LogicalTableFunctionCall.validate(operators.scala:700) > at org.apache.flink.table.api.Table.join(table.scala:539) > at org.apache.flink.table.api.Table.join(table.scala:328) > at > org.apache.flink.table.runtime.datastream.DataStreamAggregateITCase.test1(DataStreamAggregateITCase.scala:84) > {code} > The reason is in `parameterTypeEquals` method, logical as follows: > {code} > candidate == classOf[Date] && (expected == classOf[Int] || expected == > classOf[JInt]) > {code} > I think we can modify the logical of `parameterTypeEquals` method. > What do you think? Welcome anybody feedback... -- This message was sent by Atlassian JIRA (v6.3.15#6346)