Open gz opened 1 year ago
This really depends on the sql dialect you use. Some are case sensitive some aren't
From: Gerd Zellweger @.> Sent: Saturday, April 1, 2023 9:37:19 AM To: vmware/sql-to-dbsp-compiler @.> Cc: Subscribed @.***> Subject: [vmware/sql-to-dbsp-compiler] -js does not preserve case of table/view characters (Issue #144)
Right now -js makes all tables / views uppercase even though they're written as lowercase in the original sql. It would be nice if it could preserve this for the -js output.
I know SQL is not case-sensitive but it's nice to represent tables/views the same way the user spelled them in the program.
— Reply to this email directly, view it on GitHubhttps://github.com/vmware/sql-to-dbsp-compiler/issues/144, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AET7TMWG63D3BPWHTDMFV4LW7BKT7ANCNFSM6AAAAAAWPXKRFI. You are receiving this because you are subscribed to this thread.Message ID: @.***>
There are two separate questions:
T
the same as t
? This is how most SQL engines work.T
and t
in their SQL and then it is not clear what -js
should return.Note that SQL allows using quotes around identifier names if the names are to be preserved. But not all dialects agree whether these should be single quotes or double quotes.
The default implementation in Calcite will uppercase all unquoted identifiers.
Here is what my preferred solution would look like:
first question: Table T same as t? -> yes
second question: -js
should return whatever way the user wrote it, e.g.if tablename was tAbLe it should return tAbLe
Right now
-js
makes all tables / views characters uppercase even though they're written as lowercase in the original sql. It would be nice if it could preserve this for the -js output.I know SQL is not case-sensitive but it's nice to represent tables/views the same way the user spelled them in the program.