HIVE-28446: Convert some reserved words to non-reserved words
What changes were proposed in this pull request?
Mark some reserved words as non-reserved based on the ANSI standard. I did the following.
- Write unit tests using the existing parser
- Pick up keywords that are not reserved in the ANSI standard
- https://www.postgresql.org/docs/9.5/sql-keywords-appendix.html
- SQL:2023
- 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
Quality Gate passed
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
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.
Thanks