[ https://issues.apache.org/jira/browse/FLINK-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15261661#comment-15261661 ]
ASF GitHub Bot commented on FLINK-3754: --------------------------------------- Github user yjshen commented on a diff in the pull request: https://github.com/apache/flink/pull/1916#discussion_r61382801 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/TableEnvironment.scala --- @@ -355,4 +380,26 @@ object TableEnvironment { new ScalaStreamTableEnv(executionEnvironment, tableConfig) } + /** + * The primary workflow for executing plan validation for that generated from Table API. + * The validation is intentionally designed as a lazy procedure and triggered when we + * are going to run on Flink core. + */ + class PlanPreparation(val env: TableEnvironment, val logical: LogicalNode) { + + lazy val resolvedPlan: LogicalNode = env.getValidator.resolve(logical) + + def validate(): Unit = env.getValidator.validate(resolvedPlan) + + lazy val relNode: RelNode = { + env match { + case _: BatchTableEnvironment => --- End diff -- Yes, it shouldn't be distinguished. The difference should exist inside validator's rule set. > 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)