Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconsider reserved words in the CLI #20

Open
jobarr-amzn opened this issue May 31, 2023 · 0 comments
Open

Reconsider reserved words in the CLI #20

jobarr-amzn opened this issue May 31, 2023 · 0 comments

Comments

@jobarr-amzn
Copy link

When executing a query like the below, the field Time has to be quoted as "Time" in all contexts because Time is one of the SQL reserved words and that's reflected in the partiql-lang-rust lexer.

Does not work

PartiQL> select Time/1000000.0 as "ms", RequestId, Operation from read_ion('service_log.2023-05-30-19.ion') as e where RequestId is not NULL limit 10;

  × Error for query `select Time/1000000.0 as "ms", RequestId, Operation from read_ion('service_log.2023-05-30-19.ion') as e
  │ where RequestId is not NULL limit 10`

Error:   × PartiQL syntax error:
   ╭────
 1 │ select Time/1000000.0 as "ms", RequestId, Operation from read_ion('service_log.2023-05-30-19.ion') as e where RequestId is not NULL limit 10
   ·            ┬
   ·            ╰── Unexpected token `/`
   ╰────

Does work

PartiQL> select "Time"/1000000.0 as "ms", RequestId, Operation from read_ion('service_log.2023-05-30-19.ion') as e where RequestId is not NULL

Some of the words in that list seem like they'll be very common as field/column names in real data, especially "value", "time", and "date". Those don't feel like keywords to my muscle memory, and from the list of SQL reserved words on Wikipedia it seems like several large RDBMSs may agree.

I think it would be worth it to allow at least those three identifiers to be used without requiring a quoted identifier, so I'm filing this issue to prompt a discussion.

Please feel free to edit/discard this issue as appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant