hive icon indicating copy to clipboard operation
hive copied to clipboard

HIVE-28446: Convert some reserved words to non-reserved words

Open okumin opened this issue 1 year ago • 1 comments

What changes were proposed in this pull request?

Mark some reserved words as non-reserved based on the ANSI standard. I did the following.

  1. Write unit tests using the existing parser
  2. Pick up keywords that are not reserved in the ANSI standard
    • https://www.postgresql.org/docs/9.5/sql-keywords-appendix.html
    • SQL:2023
  3. Add reserved words which are not declared in the WIKI to the non-reserved list

Why are the changes needed?

We found some extra reserved keywords have been added while we were testing Hive 2 -> Hive 4. I guess some of them are intentionally reserved, but some of them are unintentionally reserved.

One point. We're not biased toward making everything non-reserved. It is OK to discard this PR and add all keywords to the WIKI.

Does this PR introduce any user-facing change?

Users can use the changed words without adding quotes.

This PR would not tighten any restrictions, so I assume this is backward compatible.

Is the change a dependency upgrade?

No.

How was this patch tested?

Added unit tests, and checked the behavior of Trino and PostgreSQL.

trino> create table hive.default.test_keywords (APPLICATION int, COMPACTIONID int, CONF int, CONNECTOR int, CONNECTORS int, DATABASE int, DDL int, EXCHANGE int, EXTENDED int, FOLLOWING int, FORCE int, IF int, LESS int, MACRO int, MORE int, OLDER int, PKFK_JOIN int, PRECEDING int, SYNC int, THAN int, TIMESTAMPLOCALTZ int, UNBOUNDED int);
CREATE TABLE
postgres=# create table test_keywords (APPLICATION int, COMPACTIONID int, CONF int, CONNECTOR int, CONNECTORS int, DATABASE int, DDL int, EXCHANGE int, EXTENDED int, FOLLOWING int, FORCE int, IF int, LESS int, MACRO int, MORE int, OLDER int, PKFK_JOIN int, PRECEDING int, SYNC int, THAN int, TIMESTAMPLOCALTZ int, UNBOUNDED int);
CREATE TABLE

okumin avatar Aug 14 '24 12:08 okumin

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reach out on the [email protected] list if the patch is in need of reviews.

github-actions[bot] avatar Oct 28 '24 00:10 github-actions[bot]

Thanks

okumin avatar Oct 28 '24 11:10 okumin