Skip to content

Commit

Permalink
Added Table explain documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chobeat committed Sep 9, 2016
1 parent f3ba22b commit fd270c4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/dev/table_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2411,3 +2411,27 @@ The Table API provides a configuration (the so-called `TableConfig`) to modify r
By default, the Table API supports `null` values. Null handling can be disabled to improve preformance by setting the `nullCheck` property in the `TableConfig` to `false`.

{% top %}

Explaining a Table
----
The Table API provides a mechanism to describe the graph of operations that leads to the resulting output. This is done through the `TableEnvironment#explain(table)` method. It returns a string describing two graphs: the Abstract Syntax Tree of the relational algebra query and the Flink's Execution Plan of the equivalent Flink's Job.

Table `explain` is supported for both `BatchTableEnvironment` and `StreamTableEnvironment`. Currently `StreamTableEnvironment` doesn't support the explanation of the Execution Plan.


<div data-lang="scala" markdown="1">
{% highlight scala %}
val env = StreamExecutionEnvironment.getExecutionEnvironment
val tEnv = TableEnvironment.getTableEnvironment(env)

val table1 = env.fromElements((1, "hello")).toTable(tEnv, 'count, 'word)
val table2 = env.fromElements((1, "hello")).toTable(tEnv, 'count, 'word)
val table = table1.unionAll(table2)

val explanation:String = tEnv.explain(table)
{% endhighlight %}
</div>
{% top %}



0 comments on commit fd270c4

Please sign in to comment.