apache / kyuubi

Apache Kyuubi is a distributed and multi-tenant gateway to provide serverless SQL on data warehouses and lakehouses.
https://kyuubi.apache.org/
Apache License 2.0
2.06k stars 904 forks source link

[TASK][EASY] Support get SQL keywords from Spark engine through API #5860

Open pan3793 opened 8 months ago

pan3793 commented 8 months ago

Code of Conduct

Search before asking

Describe the feature

SPARK-43119(Spark 3.5.0) added a SQLKeywordUtils.keywords to preserve all SQL keywords, and return such value through GetInfo#CLI_ODBC_KEYWORDS, we can do similar things at the Kyuubi side.

Motivation

No response

Describe the solution

No response

Additional context

No response

Are you willing to submit PR?

pan3793 commented 8 months ago

This ticket is for Spark, can we achieve a similar functionality in other engines? cc @YesOrNo828 @iodone @Yikf

iodone commented 8 months ago

The Trino engine currently does not support an API for keyword retrieval.

yikf commented 8 months ago

Hi @iodone , I found a newer commit that provided the API, but I didn't track its previous status, FYI: https://github.com/trinodb/trino/blob/master/core/trino-grammar/src/main/java/io/trino/grammar/sql/SqlKeywords.java#L31

iodone commented 8 months ago

It appears that the trino-cli has used this API, rather than the sql keyword information provided by the trino server.

Hi @iodone , I found a newer commit that provided the API, but I didn't track its previous status, FYI: https://github.com/trinodb/trino/blob/master/core/trino-grammar/src/main/java/io/trino/grammar/sql/SqlKeywords.java#L31