You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Rex Fenley <Re...@remind101.com> on 2020/11/17 07:26:10 UTC
IllegalStateException Printing Plan
Hello,
I have the following code attempting to print the execution plan for my job
locally. The job runs fine and Flink UI displays so I'd expect this to work.
val tableResult = userDocsTable.executeInsert(SINK_ES_PEOPLE)
println(s"execution plan:\n${this.env.getExecutionPlan()}")
but instead I end up with
Caused by: java.lang.IllegalStateException: No operators defined in
streaming topology. Cannot execute.
What am I doing wrong?
--
Rex Fenley | Software Engineer - Mobile and Backend
Remind.com <https://www.remind.com/> | BLOG <http://blog.remind.com/>
| FOLLOW
US <https://twitter.com/remindhq> | LIKE US
<https://www.facebook.com/remindhq>
Re: IllegalStateException Printing Plan
Posted by Dawid Wysakowicz <dw...@apache.org>.
I think it is currently not possible to get the AST as JSON. There is a
similar feature request here:
https://issues.apache.org/jira/browse/FLINK-19687
Best,
Dawid
On 17/11/2020 20:59, Rex Fenley wrote:
> So I tried|userDocsTable.explain()| however it doesn't give me the AST
> as JSON so that I can use the visualizer tool
> https://ci.apache.org/projects/flink/flink-docs-stable/dev/execution_plans.html
> . Also, if I get rid of executeInsert or move it to after
> getExecutionPlan I still end up with "Caused by:
> java.lang.IllegalStateException: No operators defined in streaming
> topology. Cannot execute." Ordering doesn't seem to make a difference
> here.
>
> Anything else I can try to get the JSON?
>
> Thanks!
>
> On Tue, Nov 17, 2020 at 1:24 AM Dawid Wysakowicz
> <dwysakowicz@apache.org <ma...@apache.org>> wrote:
>
> Hi Rex,
>
> The executeInsert method as the name states executes the query.
> Therefore after the method there is nothing in the topology and
> thus you get the exception.
>
> You can either explain the userDocsTable:
>
> |userDocsTable.explain()|
>
> or you can explain a statement set if you want to postpone the
> execution:
>
> |StatementSet set = tEnv.createStatementSet();|
>
> |set.addInsert(SINK_ES_PEOPLE, userDocsTable);|
>
> |set.explain()|
>
> or you can explain SQL:
>
> |String sqlQuery = ...||
> |
>
> |tEnv.explainSql(sqlQuery);|
>
> Best,
>
> Dawid
>
> On 17/11/2020 09:16, Khachatryan Roman wrote:
>> Hello,
>>
>> Can you share the full program?
>> getExecutionPlan call is probably misplaced.
>>
>> Regards,
>> Roman
>>
>>
>> On Tue, Nov 17, 2020 at 8:26 AM Rex Fenley <Rex@remind101.com
>> <ma...@remind101.com>> wrote:
>>
>> Hello,
>>
>> I have the following code attempting to print the execution
>> plan for my job locally. The job runs fine and Flink UI
>> displays so I'd expect this to work.
>>
>> valtableResult = userDocsTable.executeInsert(SINK_ES_PEOPLE)
>> println(s"execution plan:\n${this.env.getExecutionPlan()}")
>>
>> but instead I end up with
>>
>> Caused by: java.lang.IllegalStateException: No operators
>> defined in streaming topology. Cannot execute.
>>
>> What am I doing wrong?
>>
>> --
>>
>> Rex Fenley | Software Engineer - Mobile and Backend
>>
>>
>> Remind.com <https://www.remind.com/>| BLOG
>> <http://blog.remind.com/> | FOLLOW US
>> <https://twitter.com/remindhq> | LIKE US
>> <https://www.facebook.com/remindhq>
>>
>
>
> --
>
> Rex Fenley | Software Engineer - Mobile and Backend
>
>
> Remind.com <https://www.remind.com/>| BLOG
> <http://blog.remind.com/> | FOLLOW US
> <https://twitter.com/remindhq> | LIKE US
> <https://www.facebook.com/remindhq>
>
Re: IllegalStateException Printing Plan
Posted by Rex Fenley <Re...@remind101.com>.
So I tried userDocsTable.explain() however it doesn't give me the AST as
JSON so that I can use the visualizer tool
https://ci.apache.org/projects/flink/flink-docs-stable/dev/execution_plans.html
. Also, if I get rid of executeInsert or move it to after getExecutionPlan
I still end up with "Caused by: java.lang.IllegalStateException: No
operators defined in streaming topology. Cannot execute." Ordering doesn't
seem to make a difference here.
Anything else I can try to get the JSON?
Thanks!
On Tue, Nov 17, 2020 at 1:24 AM Dawid Wysakowicz <dw...@apache.org>
wrote:
> Hi Rex,
>
> The executeInsert method as the name states executes the query. Therefore
> after the method there is nothing in the topology and thus you get the
> exception.
>
> You can either explain the userDocsTable:
>
> userDocsTable.explain()
>
> or you can explain a statement set if you want to postpone the execution:
>
> StatementSet set = tEnv.createStatementSet();
>
> set.addInsert(SINK_ES_PEOPLE, userDocsTable);
>
> set.explain()
>
> or you can explain SQL:
>
> String sqlQuery = ...
>
> tEnv.explainSql(sqlQuery);
>
> Best,
>
> Dawid
> On 17/11/2020 09:16, Khachatryan Roman wrote:
>
> Hello,
>
> Can you share the full program?
> getExecutionPlan call is probably misplaced.
>
> Regards,
> Roman
>
>
> On Tue, Nov 17, 2020 at 8:26 AM Rex Fenley <Re...@remind101.com> wrote:
>
>> Hello,
>>
>> I have the following code attempting to print the execution plan for my
>> job locally. The job runs fine and Flink UI displays so I'd expect this to
>> work.
>>
>> val tableResult = userDocsTable.executeInsert(SINK_ES_PEOPLE)
>> println(s"execution plan:\n${this.env.getExecutionPlan()}")
>>
>> but instead I end up with
>>
>> Caused by: java.lang.IllegalStateException: No operators defined in
>> streaming topology. Cannot execute.
>>
>> What am I doing wrong?
>>
>> --
>>
>> Rex Fenley | Software Engineer - Mobile and Backend
>>
>>
>> Remind.com <https://www.remind.com/> | BLOG <http://blog.remind.com/>
>> | FOLLOW US <https://twitter.com/remindhq> | LIKE US
>> <https://www.facebook.com/remindhq>
>>
>
--
Rex Fenley | Software Engineer - Mobile and Backend
Remind.com <https://www.remind.com/> | BLOG <http://blog.remind.com/>
| FOLLOW
US <https://twitter.com/remindhq> | LIKE US
<https://www.facebook.com/remindhq>
Re: IllegalStateException Printing Plan
Posted by Dawid Wysakowicz <dw...@apache.org>.
Hi Rex,
The executeInsert method as the name states executes the query.
Therefore after the method there is nothing in the topology and thus you
get the exception.
You can either explain the userDocsTable:
|userDocsTable.explain()|
or you can explain a statement set if you want to postpone the execution:
|StatementSet set = tEnv.createStatementSet();|
|set.addInsert(SINK_ES_PEOPLE, userDocsTable);|
|set.explain()|
or you can explain SQL:
|String sqlQuery = ...||
|
|tEnv.explainSql(sqlQuery);|
Best,
Dawid
On 17/11/2020 09:16, Khachatryan Roman wrote:
> Hello,
>
> Can you share the full program?
> getExecutionPlan call is probably misplaced.
>
> Regards,
> Roman
>
>
> On Tue, Nov 17, 2020 at 8:26 AM Rex Fenley <Rex@remind101.com
> <ma...@remind101.com>> wrote:
>
> Hello,
>
> I have the following code attempting to print the execution plan
> for my job locally. The job runs fine and Flink UI displays so I'd
> expect this to work.
>
> valtableResult = userDocsTable.executeInsert(SINK_ES_PEOPLE)
> println(s"execution plan:\n${this.env.getExecutionPlan()}")
>
> but instead I end up with
>
> Caused by: java.lang.IllegalStateException: No operators defined
> in streaming topology. Cannot execute.
>
> What am I doing wrong?
>
> --
>
> Rex Fenley | Software Engineer - Mobile and Backend
>
>
> Remind.com <https://www.remind.com/>| BLOG
> <http://blog.remind.com/> | FOLLOW US
> <https://twitter.com/remindhq> | LIKE US
> <https://www.facebook.com/remindhq>
>
Re: IllegalStateException Printing Plan
Posted by Rex Fenley <Re...@remind101.com>.
I don't think I can share the full program.
However, the program is a long series of joines and aggs against various
sources and that is the only sink.
Thanks!
On Tue, Nov 17, 2020 at 12:17 AM Khachatryan Roman <
khachatryan.roman@gmail.com> wrote:
> Hello,
>
> Can you share the full program?
> getExecutionPlan call is probably misplaced.
>
> Regards,
> Roman
>
>
> On Tue, Nov 17, 2020 at 8:26 AM Rex Fenley <Re...@remind101.com> wrote:
>
>> Hello,
>>
>> I have the following code attempting to print the execution plan for my
>> job locally. The job runs fine and Flink UI displays so I'd expect this to
>> work.
>>
>> val tableResult = userDocsTable.executeInsert(SINK_ES_PEOPLE)
>> println(s"execution plan:\n${this.env.getExecutionPlan()}")
>>
>> but instead I end up with
>>
>> Caused by: java.lang.IllegalStateException: No operators defined in
>> streaming topology. Cannot execute.
>>
>> What am I doing wrong?
>>
>> --
>>
>> Rex Fenley | Software Engineer - Mobile and Backend
>>
>>
>> Remind.com <https://www.remind.com/> | BLOG <http://blog.remind.com/>
>> | FOLLOW US <https://twitter.com/remindhq> | LIKE US
>> <https://www.facebook.com/remindhq>
>>
>
--
Rex Fenley | Software Engineer - Mobile and Backend
Remind.com <https://www.remind.com/> | BLOG <http://blog.remind.com/>
| FOLLOW
US <https://twitter.com/remindhq> | LIKE US
<https://www.facebook.com/remindhq>
Re: IllegalStateException Printing Plan
Posted by Khachatryan Roman <kh...@gmail.com>.
Hello,
Can you share the full program?
getExecutionPlan call is probably misplaced.
Regards,
Roman
On Tue, Nov 17, 2020 at 8:26 AM Rex Fenley <Re...@remind101.com> wrote:
> Hello,
>
> I have the following code attempting to print the execution plan for my
> job locally. The job runs fine and Flink UI displays so I'd expect this to
> work.
>
> val tableResult = userDocsTable.executeInsert(SINK_ES_PEOPLE)
> println(s"execution plan:\n${this.env.getExecutionPlan()}")
>
> but instead I end up with
>
> Caused by: java.lang.IllegalStateException: No operators defined in
> streaming topology. Cannot execute.
>
> What am I doing wrong?
>
> --
>
> Rex Fenley | Software Engineer - Mobile and Backend
>
>
> Remind.com <https://www.remind.com/> | BLOG <http://blog.remind.com/> |
> FOLLOW US <https://twitter.com/remindhq> | LIKE US
> <https://www.facebook.com/remindhq>
>