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

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

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

    https://github.com/apache/flink/pull/1958#discussion_r62851129
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/expressions/call.scala
 ---
    @@ -18,85 +18,26 @@
     package org.apache.flink.api.table.expressions
     
     import org.apache.calcite.rex.RexNode
    -import org.apache.calcite.sql.SqlOperator
    -import org.apache.calcite.sql.fun.SqlStdOperatorTable
     import org.apache.calcite.tools.RelBuilder
    +import org.apache.flink.api.table.validate.{ExprValidationResult, 
ValidationFailure}
     
     /**
       * General expression for unresolved function calls. The function can be 
a built-in
       * scalar function or a user-defined scalar function.
       */
    -case class Call(functionName: String, args: Expression*) extends 
Expression {
    +case class Call(functionName: String, args: Seq[Expression]) extends 
Expression {
     
       override def children: Seq[Expression] = args
     
       override def toRexNode(implicit relBuilder: RelBuilder): RexNode = {
    -    relBuilder.call(
    -      BuiltInFunctionNames.toSqlOperator(functionName),
    -      args.map(_.toRexNode): _*)
    +    throw new UnresolvedException(s"trying to convert UnresolvedFunction 
$functionName to RexNode")
       }
     
       override def toString = s"\\$functionName(${args.mkString(", ")})"
     
    -  override def makeCopy(newArgs: Seq[AnyRef]): this.type = {
    -    val copy = Call(
    -      newArgs.head.asInstanceOf[String],
    -      newArgs.drop(1).asInstanceOf[Seq[Expression]]: _*)
    +  override def resultType =
    +    throw new UnresolvedException(s"calling dataType on Unresolved 
Function $functionName")
    --- End diff --
    
    resultType instead of dataType. Space between Unresolved Function.


> 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