Hi Amit!

The DataSet API is basically a fluent builder for the internal DAG of
operations, the "Plan". This plan is build when you call "env.execute()".

You can directly get the Plan by calling
ExecutionEnvironment#createProgramPlan()

The JSON plan has in addition the information inserted by the Optimizer
(what partitioning to use where, what keys to use). This is called the
"OptimizedPlan".
To obtain that, you have to push the Plan through the Optimizer:
"OptimizedPlan op = new Optimizer(new DataStaristics(), new
DefaultCostEstimator()).compile(plan)"

That optimized plan has everything in information for the execution. The
JSON is created from that OptimizedPlan via "new
PlanJSONDumpGenerator().getOptimizerPlanAsJSON(optimizedPlan)"

Note: These classnames and instructions refer to Flink 0.9. For version
0.8, the names are a bit different.

Greetings,
Stephan



On Mon, Mar 30, 2015 at 5:22 PM, Amit Pawar <amitpawar5...@gmail.com> wrote:

> Hi
>
> I am trying to extract/retrieve the Flink execution plan. I managed to get
> it as JSON string in following ways:
> 1. Using JAR - via PackagedProgram using getPreviewPlan() ; or
> 2. Directly in program - via ExecutionEnvironment's getExecutionPlan()
>
> My question is - Is it possible to retrieve directly the Plan object?
> I tried for this but was not successful as submitting the jar takes us into
> interactive mode, and in order to use the other mode, programEntryPoint,
> the main class needs to implement Program interface with getPlan method.
>
> Even if we manage to get the execution plan as a Plan object, will it be
> different from what we have using JSON string? like in terms of -
> 1. What are the datatypes used in the dataset's tuple
> 2. On what key is the Join taking place
> 3. Filtering predicate
> 4. Field for Distinct and so on
> (JSON plan does have the operator tree but the contents field points to the
> line of code in the class, which is not that helpful)
>
> If not, is it possible (by some other way) to get the above details just by
> using the Flink job/jar as an input?
>
>
> Thanks and Regards
> Amit Pawar
>

Reply via email to