You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by Mingliang Liu <li...@apache.org> on 2022/12/21 08:47:37 UTC

[Discuss] SQL Client syntax to show a configuration

Hi all,

Currently in SQL Client we can use the "SET 'key'='value'" command to set a
value to a config property key for the session. We can also list all config
properties by just calling "SET". It would be convenient to show the value
of a specific config property given its key(s). Without this, users will
need to eyeball the very one config from all config properties which may
need scrolling the screen.

I do not find a standard SQL syntax for this.
- Some use the syntax "SET 'key'" to show the value, for e.g. Spark SQL and
Hive.
- Some use the "SHOW" keyword to show session properties, for
e.g. CockroachDB. Trino and MySqL support a key pattern in the "SHOW
SESSION" statement.

I filed FLINK-30459 to track this. I also attached initial PR #21535 that
uses the "SET 'key'" syntax. I chose that because I previously used this
syntax. It seems simpler to just use one keyword to interact with
session configs. When using Hive dialect, Flink SQL also supports that.
However, it's not straightforward enough and one probably needs to check
the doc first.

As Martijn suggested, before improving the code, it's better to get it
discussed here first. So, is it a good idea to add this support? Which
syntax is preferred by our community, and are there other better ways of
supporting this?

Thanks,

Re: [Discuss] SQL Client syntax to show a configuration

Posted by Sergey Nuyanzin <sn...@gmail.com>.
Hi Mingliang,

Thanks for bringing this up
From one side, yes some engines use SHOW syntax and I would rather +0.5
here.

From another side both SHOW and SET are very limited commands.
Maybe it would make sense to look at information_schema (mentioned in SQL
92[1])
and most databases already support it (Postgres[2], MySQL[3], CockRoach[4]).
Hive does not support it yet however there are some activities in that
direction[5].
This approach will allow to query from these tables
 (not only properties, also functions, databases and all other data
available via SHOW command)
 as from any other Flink tables.

[1] https://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
[2] https://www.postgresql.org/docs/current/information-schema.html
[3] https://dev.mysql.com/doc/refman/8.0/en/information-schema.html
[4] https://www.cockroachlabs.com/docs/stable/information-schema.html
[5] https://issues.apache.org/jira/browse/HIVE-1010

On Wed, Dec 21, 2022 at 12:09 PM yuxia <lu...@alumni.sjtu.edu.cn> wrote:

> HI, Mingliang.
> Thanks for bringing this up. +1 to add this support.
> I think use syntax "SET 'key'" to show a signle variable is weird, but use
> it may be more convinent and more unified since we have used "SET" to show
> all variable.
> Considering many hive/spark users may be used to it,  seems use "SET
> 'key'" is also acceptable.
> But I have no much strong preference, use some other thing like "SHOW"
> statement also sounds good to me.
>
> Best regards,
> Yuxia
>
> ----- 原始邮件 -----
> 发件人: "Martijn Visser" <ma...@apache.org>
> 收件人: "dev" <de...@flink.apache.org>
> 发送时间: 星期三, 2022年 12 月 21日 下午 5:44:15
> 主题: Re: [Discuss] SQL Client syntax to show a configuration
>
> Hi Mingliang,
>
> Thanks for opening a discussion thread on this topic, much appreciated. If
> there is no standard SQL for this, then we should have a discussion on this
> topic indeed.
>
> I'm not a fan of using "SET" to show a value. For me, "SET" implies that
> you are setting a value. I prefer "SHOW" since that clearly identifies that
> you want to display a value. Curious what others think on this topic.
>
> Best regards,
>
> Martijn
>
> On Wed, Dec 21, 2022 at 9:48 AM Mingliang Liu <li...@apache.org> wrote:
>
> > Hi all,
> >
> > Currently in SQL Client we can use the "SET 'key'='value'" command to
> set a
> > value to a config property key for the session. We can also list all
> config
> > properties by just calling "SET". It would be convenient to show the
> value
> > of a specific config property given its key(s). Without this, users will
> > need to eyeball the very one config from all config properties which may
> > need scrolling the screen.
> >
> > I do not find a standard SQL syntax for this.
> > - Some use the syntax "SET 'key'" to show the value, for e.g. Spark SQL
> and
> > Hive.
> > - Some use the "SHOW" keyword to show session properties, for
> > e.g. CockroachDB. Trino and MySqL support a key pattern in the "SHOW
> > SESSION" statement.
> >
> > I filed FLINK-30459 to track this. I also attached initial PR #21535 that
> > uses the "SET 'key'" syntax. I chose that because I previously used this
> > syntax. It seems simpler to just use one keyword to interact with
> > session configs. When using Hive dialect, Flink SQL also supports that.
> > However, it's not straightforward enough and one probably needs to check
> > the doc first.
> >
> > As Martijn suggested, before improving the code, it's better to get it
> > discussed here first. So, is it a good idea to add this support? Which
> > syntax is preferred by our community, and are there other better ways of
> > supporting this?
> >
> > Thanks,
> >
>


-- 
Best regards,
Sergey

Re: [Discuss] SQL Client syntax to show a configuration

Posted by yuxia <lu...@alumni.sjtu.edu.cn>.
HI, Mingliang.
Thanks for bringing this up. +1 to add this support.
I think use syntax "SET 'key'" to show a signle variable is weird, but use it may be more convinent and more unified since we have used "SET" to show all variable. 
Considering many hive/spark users may be used to it,  seems use "SET 'key'" is also acceptable.
But I have no much strong preference, use some other thing like "SHOW" statement also sounds good to me.

Best regards,
Yuxia

----- 原始邮件 -----
发件人: "Martijn Visser" <ma...@apache.org>
收件人: "dev" <de...@flink.apache.org>
发送时间: 星期三, 2022年 12 月 21日 下午 5:44:15
主题: Re: [Discuss] SQL Client syntax to show a configuration

Hi Mingliang,

Thanks for opening a discussion thread on this topic, much appreciated. If
there is no standard SQL for this, then we should have a discussion on this
topic indeed.

I'm not a fan of using "SET" to show a value. For me, "SET" implies that
you are setting a value. I prefer "SHOW" since that clearly identifies that
you want to display a value. Curious what others think on this topic.

Best regards,

Martijn

On Wed, Dec 21, 2022 at 9:48 AM Mingliang Liu <li...@apache.org> wrote:

> Hi all,
>
> Currently in SQL Client we can use the "SET 'key'='value'" command to set a
> value to a config property key for the session. We can also list all config
> properties by just calling "SET". It would be convenient to show the value
> of a specific config property given its key(s). Without this, users will
> need to eyeball the very one config from all config properties which may
> need scrolling the screen.
>
> I do not find a standard SQL syntax for this.
> - Some use the syntax "SET 'key'" to show the value, for e.g. Spark SQL and
> Hive.
> - Some use the "SHOW" keyword to show session properties, for
> e.g. CockroachDB. Trino and MySqL support a key pattern in the "SHOW
> SESSION" statement.
>
> I filed FLINK-30459 to track this. I also attached initial PR #21535 that
> uses the "SET 'key'" syntax. I chose that because I previously used this
> syntax. It seems simpler to just use one keyword to interact with
> session configs. When using Hive dialect, Flink SQL also supports that.
> However, it's not straightforward enough and one probably needs to check
> the doc first.
>
> As Martijn suggested, before improving the code, it's better to get it
> discussed here first. So, is it a good idea to add this support? Which
> syntax is preferred by our community, and are there other better ways of
> supporting this?
>
> Thanks,
>

Re: [Discuss] SQL Client syntax to show a configuration

Posted by Martijn Visser <ma...@apache.org>.
Hi Mingliang,

Thanks for opening a discussion thread on this topic, much appreciated. If
there is no standard SQL for this, then we should have a discussion on this
topic indeed.

I'm not a fan of using "SET" to show a value. For me, "SET" implies that
you are setting a value. I prefer "SHOW" since that clearly identifies that
you want to display a value. Curious what others think on this topic.

Best regards,

Martijn

On Wed, Dec 21, 2022 at 9:48 AM Mingliang Liu <li...@apache.org> wrote:

> Hi all,
>
> Currently in SQL Client we can use the "SET 'key'='value'" command to set a
> value to a config property key for the session. We can also list all config
> properties by just calling "SET". It would be convenient to show the value
> of a specific config property given its key(s). Without this, users will
> need to eyeball the very one config from all config properties which may
> need scrolling the screen.
>
> I do not find a standard SQL syntax for this.
> - Some use the syntax "SET 'key'" to show the value, for e.g. Spark SQL and
> Hive.
> - Some use the "SHOW" keyword to show session properties, for
> e.g. CockroachDB. Trino and MySqL support a key pattern in the "SHOW
> SESSION" statement.
>
> I filed FLINK-30459 to track this. I also attached initial PR #21535 that
> uses the "SET 'key'" syntax. I chose that because I previously used this
> syntax. It seems simpler to just use one keyword to interact with
> session configs. When using Hive dialect, Flink SQL also supports that.
> However, it's not straightforward enough and one probably needs to check
> the doc first.
>
> As Martijn suggested, before improving the code, it's better to get it
> discussed here first. So, is it a good idea to add this support? Which
> syntax is preferred by our community, and are there other better ways of
> supporting this?
>
> Thanks,
>