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" <martijnvis...@apache.org> 收件人: "dev" <dev@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 <lium...@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, >