You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by liangji <ji...@gmail.com> on 2020/07/02 10:12:28 UTC

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

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/

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

Posted by Benchao Li <li...@apache.org>.
这个应该可以生效的,我们就是这样用的。

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

Yang Wang <da...@gmail.com> 于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 <ji...@gmail.com> 于2020年7月3日周五 下午3:19写道:
>
> > Hi,
> >
> > 如果你是写代码来使用TableEnvironment的,
> > 你要显示的在代码中塞进TableConfig中:
> >
> > Configuration configuration = tEnv.getConfig().getConfiguration();
> > configuration.addAll(GlobalConfiguration.loadConfiguration());
> >
> > CC: @Yang Wang <da...@gmail.com>
> GlobalConfiguration是个internal的类,有没有public
> > API获取对应的Configuration?
> >
> > Best,
> > Jingsong
> >
> > On Fri, Jul 3, 2020 at 3:07 PM Yang Wang <da...@gmail.com> wrote:
> >
> >> 我理解在Yarn上运行,通过-yD传入和写在flink-conf.yaml里面都是可以生效的
> >>
> >>
> >> Best,
> >> Yang
> >>
> >> liangji <ji...@gmail.com> 于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

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

Posted by Yang Wang <da...@gmail.com>.
其实是没有Public的API去从文件load Configuration的,因为我理解这是个Client端的内部逻辑

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

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


Best,
Yang

Jingsong Li <ji...@gmail.com> 于2020年7月3日周五 下午3:19写道:

> Hi,
>
> 如果你是写代码来使用TableEnvironment的,
> 你要显示的在代码中塞进TableConfig中:
>
> Configuration configuration = tEnv.getConfig().getConfiguration();
> configuration.addAll(GlobalConfiguration.loadConfiguration());
>
> CC: @Yang Wang <da...@gmail.com> GlobalConfiguration是个internal的类,有没有public
> API获取对应的Configuration?
>
> Best,
> Jingsong
>
> On Fri, Jul 3, 2020 at 3:07 PM Yang Wang <da...@gmail.com> wrote:
>
>> 我理解在Yarn上运行,通过-yD传入和写在flink-conf.yaml里面都是可以生效的
>>
>>
>> Best,
>> Yang
>>
>> liangji <ji...@gmail.com> 于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
>

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

Posted by Jingsong Li <ji...@gmail.com>.
Hi,

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

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

CC: @Yang Wang <da...@gmail.com>
GlobalConfiguration是个internal的类,有没有public
API获取对应的Configuration?

Best,
Jingsong

On Fri, Jul 3, 2020 at 3:07 PM Yang Wang <da...@gmail.com> wrote:

> 我理解在Yarn上运行,通过-yD传入和写在flink-conf.yaml里面都是可以生效的
>
>
> Best,
> Yang
>
> liangji <ji...@gmail.com> 于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

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

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


Best,
Yang

liangji <ji...@gmail.com> 于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/
>