[ https://issues.apache.org/jira/browse/FLINK-5257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15725041#comment-15725041 ]
ASF GitHub Bot commented on FLINK-5257: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/2949#discussion_r91049096 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/BatchTableEnvironment.scala --- @@ -275,17 +278,27 @@ abstract class BatchTableEnvironment( * Table API calls and / or SQL queries and generating corresponding [[DataSet]] operators. * * @param table The root node of the relational expression tree. - * @param tpe The [[TypeInformation]] of the resulting [[DataSet]]. + * @param tpe The [[TypeInformation]] of the resulting [[DataSet]]. * @tparam A The type of the resulting [[DataSet]]. * @return The [[DataSet]] that corresponds to the translated [[Table]]. */ protected def translate[A](table: Table)(implicit tpe: TypeInformation[A]): DataSet[A] = { + val dataSetPlan = optimize(table.getRelNode) + translate(dataSetPlan) + } + /** + * Translates a logical [[RelNode]] into a [[DataSet]]. + * + * @param logicalPlan The root node of the relational expression tree. + * @param tpe The [[TypeInformation]] of the resulting [[DataSet]]. + * @tparam A The type of the resulting [[DataSet]]. + * @return The [[DataSet]] that corresponds to the translated [[Table]]. + */ + protected def translate[A](logicalPlan: RelNode)(implicit tpe: TypeInformation[A]): DataSet[A] = { --- End diff -- Just noticed when checking the PR for the merge. This line exceeds the 100 char limit of our Scala style. Please run a local build before opening a PR to catch these issues. Usually it is sufficient to build the modules you touched in the PR (`flink-table` in this case) with `mvn clean install`. > Display optimized logical plan when explaining table > ---------------------------------------------------- > > Key: FLINK-5257 > URL: https://issues.apache.org/jira/browse/FLINK-5257 > Project: Flink > Issue Type: Improvement > Components: Table API & SQL > Reporter: Kurt Young > Assignee: Kurt Young > Priority: Minor > > Currently when we use {{BatchTableEnvironment}} or {{StreamTableEnvironment}} > to explain a table, it only print out the "Abstract Syntax Tree" and > "Physical Execution Plan". Would be nice to have the "Optimized Logical Plan" > also printed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)