[ https://issues.apache.org/jira/browse/FLINK-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15278164#comment-15278164 ]
ASF GitHub Bot commented on FLINK-3754: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/1958#discussion_r62680699 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/TableEnvironment.scala --- @@ -152,13 +160,13 @@ abstract class TableEnvironment(val config: TableConfig) { * * @param name The name under which the table is registered. * @param table The table to register in the catalog - * @throws TableException if another table is registered under the provided name. + * @throws ValidationException if another table is registered under the provided name. */ - @throws[TableException] + @throws[ValidationException] protected def registerTableInternal(name: String, table: AbstractTable): Unit = { if (isRegistered(name)) { - throw new TableException(s"Table \'$name\' already exists. " + + throw new ValidationException(s"Table \'$name\' already exists. " + --- End diff -- I think we can keep `TableException` here. I would use `ValidationException` for all invalid expressions within Table API queries. `TableException` can be used for invalid use of the Table API in general (registering tables under existing names, ...) + current limitations (DataTypes, non-equality joins, etc.). Do you think such a separation would make sense? > 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)