[
https://issues.apache.org/jira/browse/FLINK-3192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15088773#comment-15088773
]
ASF GitHub Bot commented on FLINK-3192:
---------------------------------------
Github user ChengXiangLi commented on a diff in the pull request:
https://github.com/apache/flink/pull/1477#discussion_r49161249
--- Diff:
flink-staging/flink-table/src/main/scala/org/apache/flink/api/table/Table.scala
---
@@ -267,5 +271,24 @@ case class Table(private[flink] val operation:
PlanNode) {
this.copy(operation = UnionAll(operation, right.operation))
}
+ /**
+ * Get the process of the sql parsing, print AST and physical execution
plan.The AST
+ * show the structure of the supplied statement. The execution plan
shows how the table
+ * referenced by the statement will be scanned.
+ */
+ def explain(extended: Boolean): String = {
+ val ast = operation
+ val dataSet = this.toDataSet[Row]
+ val env = dataSet.getExecutionEnvironment
+ dataSet.output(new DiscardingOutputFormat[Row])
+ val string = env.getExecutionPlan()
--- End diff --
It's better to use some meaningful variable name here.
> Add explain support to print ast and sql physical execution plan.
> ------------------------------------------------------------------
>
> Key: FLINK-3192
> URL: https://issues.apache.org/jira/browse/FLINK-3192
> Project: Flink
> Issue Type: New Feature
> Components: Table API
> Reporter: GaoLun
> Assignee: GaoLun
> Priority: Minor
> Labels: features
>
> Table API doesn't support sql-explanation now. Add the explain support to
> print ast (abstract syntax tree) and the physical execution plan of sql.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)