table execution-options 能否通过 -yd 生效

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

table execution-options 能否通过 -yd 生效

liangji
https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/config.html#execution-options
// instantiate table environment
TableEnvironment tEnv = ...

// access flink configuration
Configuration configuration = tEnv.getConfig().getConfiguration();
// set low-level key-value options
configuration.setString("table.exec.mini-batch.enabled", "true");
configuration.setString("table.exec.mini-batch.allow-latency", "5 s");
configuration.setString("table.exec.mini-batch.size", "5000");

请问下,table的这些参数是不是只能在代码里面设置,通过 -yd 传入可否生效呢?



--
Sent from: http://apache-flink.147419.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: table execution-options 能否通过 -yd 生效

Yang Wang
我理解在Yarn上运行,通过-yD传入和写在flink-conf.yaml里面都是可以生效的


Best,
Yang

liangji <[hidden email]> 于2020年7月2日周四 下午6:12写道:

>
> https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/config.html#execution-options
> // instantiate table environment
> TableEnvironment tEnv = ...
>
> // access flink configuration
> Configuration configuration = tEnv.getConfig().getConfiguration();
> // set low-level key-value options
> configuration.setString("table.exec.mini-batch.enabled", "true");
> configuration.setString("table.exec.mini-batch.allow-latency", "5 s");
> configuration.setString("table.exec.mini-batch.size", "5000");
>
> 请问下,table的这些参数是不是只能在代码里面设置,通过 -yd 传入可否生效呢?
>
>
>
> --
> Sent from: http://apache-flink.147419.n8.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: table execution-options 能否通过 -yd 生效

Jingsong Li
Hi,

如果你是写代码来使用TableEnvironment的,
你要显示的在代码中塞进TableConfig中:

Configuration configuration = tEnv.getConfig().getConfiguration();
configuration.addAll(GlobalConfiguration.loadConfiguration());

CC: @Yang Wang <[hidden email]>
GlobalConfiguration是个internal的类,有没有public
API获取对应的Configuration?

Best,
Jingsong

On Fri, Jul 3, 2020 at 3:07 PM Yang Wang <[hidden email]> wrote:

> 我理解在Yarn上运行,通过-yD传入和写在flink-conf.yaml里面都是可以生效的
>
>
> Best,
> Yang
>
> liangji <[hidden email]> 于2020年7月2日周四 下午6:12写道:
>
> >
> >
> https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/config.html#execution-options
> > // instantiate table environment
> > TableEnvironment tEnv = ...
> >
> > // access flink configuration
> > Configuration configuration = tEnv.getConfig().getConfiguration();
> > // set low-level key-value options
> > configuration.setString("table.exec.mini-batch.enabled", "true");
> > configuration.setString("table.exec.mini-batch.allow-latency", "5 s");
> > configuration.setString("table.exec.mini-batch.size", "5000");
> >
> > 请问下,table的这些参数是不是只能在代码里面设置,通过 -yd 传入可否生效呢?
> >
> >
> >
> > --
> > Sent from: http://apache-flink.147419.n8.nabble.com/
> >
>


--
Best, Jingsong Lee
Reply | Threaded
Open this post in threaded view
|

Re: table execution-options 能否通过 -yd 生效

Yang Wang
其实是没有Public的API去从文件load Configuration的,因为我理解这是个Client端的内部逻辑

在用户调用了flink run以后,client会把conf/flink-conf.yaml加载,并apply上dynamic options,
然后会把这个Configuration传给各个Environment去使用

如果TableEnvironment在构建的时候没有使用传过来的Configuration,那-yD就没有办法生效了
只能用户在代码里面再设置一次


Best,
Yang

Jingsong Li <[hidden email]> 于2020年7月3日周五 下午3:19写道:

> Hi,
>
> 如果你是写代码来使用TableEnvironment的,
> 你要显示的在代码中塞进TableConfig中:
>
> Configuration configuration = tEnv.getConfig().getConfiguration();
> configuration.addAll(GlobalConfiguration.loadConfiguration());
>
> CC: @Yang Wang <[hidden email]> GlobalConfiguration是个internal的类,有没有public
> API获取对应的Configuration?
>
> Best,
> Jingsong
>
> On Fri, Jul 3, 2020 at 3:07 PM Yang Wang <[hidden email]> wrote:
>
>> 我理解在Yarn上运行,通过-yD传入和写在flink-conf.yaml里面都是可以生效的
>>
>>
>> Best,
>> Yang
>>
>> liangji <[hidden email]> 于2020年7月2日周四 下午6:12写道:
>>
>> >
>> >
>> https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/config.html#execution-options
>> > // instantiate table environment
>> > TableEnvironment tEnv = ...
>> >
>> > // access flink configuration
>> > Configuration configuration = tEnv.getConfig().getConfiguration();
>> > // set low-level key-value options
>> > configuration.setString("table.exec.mini-batch.enabled", "true");
>> > configuration.setString("table.exec.mini-batch.allow-latency", "5 s");
>> > configuration.setString("table.exec.mini-batch.size", "5000");
>> >
>> > 请问下,table的这些参数是不是只能在代码里面设置,通过 -yd 传入可否生效呢?
>> >
>> >
>> >
>> > --
>> > Sent from: http://apache-flink.147419.n8.nabble.com/
>> >
>>
>
>
> --
> Best, Jingsong Lee
>
Reply | Threaded
Open this post in threaded view
|

Re: table execution-options 能否通过 -yd 生效

Benchao Li-2
这个应该可以生效的,我们就是这样用的。

如果没理解错,在`PlannerBase#mergeParameters`会把ExecutionEnvironment中的参数和TableConfig的参数合并的。

Yang Wang <[hidden email]> 于2020年7月3日周五 下午5:10写道:

> 其实是没有Public的API去从文件load Configuration的,因为我理解这是个Client端的内部逻辑
>
> 在用户调用了flink run以后,client会把conf/flink-conf.yaml加载,并apply上dynamic options,
> 然后会把这个Configuration传给各个Environment去使用
>
> 如果TableEnvironment在构建的时候没有使用传过来的Configuration,那-yD就没有办法生效了
> 只能用户在代码里面再设置一次
>
>
> Best,
> Yang
>
> Jingsong Li <[hidden email]> 于2020年7月3日周五 下午3:19写道:
>
> > Hi,
> >
> > 如果你是写代码来使用TableEnvironment的,
> > 你要显示的在代码中塞进TableConfig中:
> >
> > Configuration configuration = tEnv.getConfig().getConfiguration();
> > configuration.addAll(GlobalConfiguration.loadConfiguration());
> >
> > CC: @Yang Wang <[hidden email]>
> GlobalConfiguration是个internal的类,有没有public
> > API获取对应的Configuration?
> >
> > Best,
> > Jingsong
> >
> > On Fri, Jul 3, 2020 at 3:07 PM Yang Wang <[hidden email]> wrote:
> >
> >> 我理解在Yarn上运行,通过-yD传入和写在flink-conf.yaml里面都是可以生效的
> >>
> >>
> >> Best,
> >> Yang
> >>
> >> liangji <[hidden email]> 于2020年7月2日周四 下午6:12写道:
> >>
> >> >
> >> >
> >>
> https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/config.html#execution-options
> >> > // instantiate table environment
> >> > TableEnvironment tEnv = ...
> >> >
> >> > // access flink configuration
> >> > Configuration configuration = tEnv.getConfig().getConfiguration();
> >> > // set low-level key-value options
> >> > configuration.setString("table.exec.mini-batch.enabled", "true");
> >> > configuration.setString("table.exec.mini-batch.allow-latency", "5 s");
> >> > configuration.setString("table.exec.mini-batch.size", "5000");
> >> >
> >> > 请问下,table的这些参数是不是只能在代码里面设置,通过 -yd 传入可否生效呢?
> >> >
> >> >
> >> >
> >> > --
> >> > Sent from: http://apache-flink.147419.n8.nabble.com/
> >> >
> >>
> >
> >
> > --
> > Best, Jingsong Lee
> >
>


--

Best,
Benchao Li