Skip to content

Instantly share code, notes, and snippets.

@okumin
Last active August 22, 2024 10:09
Show Gist options
  • Save okumin/46731e8209754b03aa5bc3d7dbde5700 to your computer and use it in GitHub Desktop.
Save okumin/46731e8209754b03aa5bc3d7dbde5700 to your computer and use it in GitHub Desktop.
Hive keyword changes

Summary.

  • Non-reserved
    • Removed: HOLD_DDLTIME, IGNORE, NO_DROP, OFFLINE, PROTECTION, READONLY, REGEXP, RLIKE
    • Added: AUTOCOMMIT, ISOLATION, LEVEL, OFFSET, SNAPSHOT, TRANSACTION, WORK, WRITE
  • Reserved
    • Removed:
    • Added: COMMIT, ONLY, REGEXP, RLIKE, ROLLBACK, START

The list of changed keywords.

git checkout release-1.2.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-1.2.0.txt
git checkout release-2.0.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-2.0.0.txt
diff /tmp/keywords-1.2.0.txt /tmp/keywords-2.0.0.txt
12a13
> KW_AUTOCOMMIT: 'AUTOCOMMIT';
33a35
> KW_COMMIT: 'COMMIT';
100d101
< KW_HOLD_DDLTIME: 'HOLD_DDLTIME';
104d104
< KW_IGNORE: 'IGNORE';
118a119
> KW_ISOLATION: 'ISOLATION';
126a128
> KW_LEVEL: 'LEVEL';
150d151
< KW_NO_DROP: 'NO_DROP';
153c154
< KW_OFFLINE: 'OFFLINE';
---
> KW_OFFSET: 'OFFSET';
154a156
> KW_ONLY: 'ONLY';
176d177
< KW_PROTECTION: 'PROTECTION';
180d180
< KW_READONLY: 'READONLY';
198a199
> KW_ROLLBACK: 'ROLLBACK';
216a218
> KW_SNAPSHOT: 'SNAPSHOT';
219a222
> KW_START: 'START';
235a239
> KW_TRANSACTION: 'TRANSACTION';
265a270,271
> KW_WORK: 'WORK';
> KW_WRITE: 'WRITE';

The list of non-reserved words.

git checkout release-1.2.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-1.2.0.txt
git checkout release-2.0.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-2.0.0.txt
diff /tmp/non-reserved-1.2.0.txt /tmp/non-reserved-2.0.0.txt 
11c11
<     | KW_KEYS | KW_KEY_TYPE | KW_LIMIT | KW_LINES | KW_LOAD | KW_LOCATION | KW_LOCK | KW_LOCKS | KW_LOGICAL | KW_LONG
---
>     | KW_KEYS | KW_KEY_TYPE | KW_LIMIT | KW_OFFSET | KW_LINES | KW_LOAD | KW_LOCATION | KW_LOCK | KW_LOCKS | KW_LOGICAL | KW_LONG
15c15
<     | KW_REGEXP | KW_RELOAD | KW_RENAME | KW_REPAIR | KW_REPLACE | KW_REPLICATION | KW_RESTRICT | KW_REWRITE | KW_RLIKE
---
>     | KW_RELOAD | KW_RENAME | KW_REPAIR | KW_REPLACE | KW_REPLICATION | KW_RESTRICT | KW_REWRITE
21c21,28
<     ;
---
>     | KW_WORK
>     | KW_TRANSACTION
>     | KW_WRITE
>     | KW_ISOLATION
>     | KW_LEVEL
>     | KW_SNAPSHOT
>     | KW_AUTOCOMMIT
> ;
23c30
< //The following SQL2011 reserved keywords are used as cast function name only, it is a subset of the sql11ReservedKeywordsUsedAsIdentifier.
---
> //The following SQL2011 reserved keywords are used as cast function name only, but not as identifiers.
29a37,38
> //We are planning to remove the following whole list after several releases.
> //Thus, please do not change the following list unless you know what to do.
39c48,50
<     | KW_TRUNCATE | KW_UNION | KW_UPDATE | KW_USER | KW_USING | KW_VALUES | KW_WITH
---
>     | KW_TRUNCATE | KW_UNION | KW_UPDATE | KW_USER | KW_USING | KW_VALUES | KW_WITH 
> //The following two keywords come from MySQL. Although they are not keywords in SQL2011, they are reserved keywords in MySQL.    
>     | KW_REGEXP | KW_RLIKE

Summary

  • Non-reserved
    • Removed:
    • Added: ABORT, KEY, LAST, NORELY, NOVALIDATE, NULLS, RELY, VALIDATE
  • Reserved
    • Removed:
    • Added: CACHE, CONSTRAINT, FOREIGN, PRIMARY, REFERENCES

The list of changed keywords.

git checkout release-2.0.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-2.0.0.txt
git checkout rel/release-2.1.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-2.1.0.txt
diff /tmp/keywords-2.0.0.txt /tmp/keywords-2.1.0.txt        
0a1
> KW_ABORT: 'ABORT';
22a24
> KW_CACHE: 'CACHE';
40a43
> KW_CONSTRAINT: 'CONSTRAINT';
91a95
> KW_FOREIGN: 'FOREIGN';
122a127
> KW_KEY: 'KEY';
124a130
> KW_LAST : 'LAST';
149a156
> KW_NORELY: 'NORELY';
151a159
> KW_NOVALIDATE: 'NOVALIDATE';
152a161
> KW_NULLS : 'NULLS';
175a185
> KW_PRIMARY: 'PRIMARY';
185a196
> KW_REFERENCES: 'REFERENCES';
187a199
> KW_RELY: 'RELY';
260a273
> KW_VALIDATE: 'VALIDATE';

The list of non-reserved keywords.

git checkout release-2.0.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-2.0.0.txt
git checkout rel/release-2.1.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-2.1.0.txt
diff /tmp/non-reserved-2.0.0.txt /tmp/non-reserved-2.1.0.txt 
3c3
<     KW_ADD | KW_ADMIN | KW_AFTER | KW_ANALYZE | KW_ARCHIVE | KW_ASC | KW_BEFORE | KW_BUCKET | KW_BUCKETS
---
>     KW_ABORT | KW_ADD | KW_ADMIN | KW_AFTER | KW_ANALYZE | KW_ARCHIVE | KW_ASC | KW_BEFORE | KW_BUCKET | KW_BUCKETS
11,12c11,12
<     | KW_KEYS | KW_KEY_TYPE | KW_LIMIT | KW_OFFSET | KW_LINES | KW_LOAD | KW_LOCATION | KW_LOCK | KW_LOCKS | KW_LOGICAL | KW_LONG
<     | KW_MAPJOIN | KW_MATERIALIZED | KW_METADATA | KW_MINUS | KW_MINUTE | KW_MONTH | KW_MSCK | KW_NOSCAN | KW_NO_DROP | KW_OFFLINE
---
>     | KW_KEYS | KW_KEY_TYPE | KW_LAST | KW_LIMIT | KW_OFFSET | KW_LINES | KW_LOAD | KW_LOCATION | KW_LOCK | KW_LOCKS | KW_LOGICAL | KW_LONG
>     | KW_MAPJOIN | KW_MATERIALIZED | KW_METADATA | KW_MINUS | KW_MINUTE | KW_MONTH | KW_MSCK | KW_NOSCAN | KW_NO_DROP | KW_NULLS | KW_OFFLINE
27a28,32
>     | KW_RELY
>     | KW_NORELY
>     | KW_VALIDATE
>     | KW_NOVALIDATE
>     | KW_KEY
50c55,59
<     | KW_REGEXP | KW_RLIKE
---
>     | KW_REGEXP | KW_RLIKE 
>     | KW_PRIMARY
>     | KW_FOREIGN
>     | KW_CONSTRAINT
>     | KW_REFERENCES

Summary.

  • Non-reserved
    • Removed: MINUS
    • Added: CACHE, DAYS, DAYOFWEEK, DUMP, HOURS, MATCHED, MERGE, MINUTES, MONTHS, QUARTER, REPL, SECONDS, STATUS, VIEWS, WEEK, WEEKS, YEARS
  • Reserved
    • Removed: CACHE
    • Added: EXCEPT, EXTRACT, FLOOR, GROUPING, INTEGER, MINUS, PRECISION

The list of changed keywords.

git checkout rel/release-2.1.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-2.1.0.txt
git checkout rel/release-2.2.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-2.2.0.txt
diff /tmp/keywords-2.1.0.txt /tmp/keywords-2.2.0.txt        
57c57
< KW_DAY: 'DAY';
---
> KW_DAY: 'DAY' | 'DAYS';
72a73
> KW_DOW: 'DAYOFWEEK';
73a75
> KW_DUMP: 'DUMP';
78a81
> KW_EXCEPT: 'EXCEPT';
85a89
> KW_EXTRACT: 'EXTRACT';
92a97
> KW_FLOOR: 'FLOOR';
106c111
< KW_HOUR: 'HOUR';
---
> KW_HOUR: 'HOUR' | 'HOURS';
118c123
< KW_INT: 'INT';
---
> KW_INT: 'INT' | 'INTEGER';
147a153
> KW_MATCHED: 'MATCHED';
148a155
> KW_MERGE: 'MERGE';
151,152c158,159
< KW_MINUTE: 'MINUTE';
< KW_MONTH: 'MONTH';
---
> KW_MINUTE: 'MINUTE' | 'MINUTES';
> KW_MONTH: 'MONTH' | 'MONTHS';
182a190
> KW_PRECISION: 'PRECISION';
188a197
> KW_QUARTER: 'QUARTER';
201a211
> KW_REPL: 'REPL';
217c227
< KW_SECOND: 'SECOND';
---
> KW_SECOND: 'SECOND' | 'SECONDS';
235a246
> KW_STATUS: 'STATUS';
277a289,290
> KW_VIEWS: 'VIEWS';
> KW_WEEK: 'WEEK' | 'WEEKS';
285c298
< KW_YEAR: 'YEAR';
---
> KW_YEAR: 'YEAR' | 'YEARS';

The list of non-reserved keywords.

git checkout rel/release-2.1.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-2.1.0.txt
git checkout rel/release-2.2.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-2.2.0.txt
diff /tmp/non-reserved-2.1.0.txt /tmp/non-reserved-2.2.0.txt 
7c7
<     | KW_DESC | KW_DIRECTORIES | KW_DIRECTORY | KW_DISABLE | KW_DISTRIBUTE | KW_ELEM_TYPE 
---
>     | KW_DESC | KW_DIRECTORIES | KW_DIRECTORY | KW_DISABLE | KW_DISTRIBUTE | KW_DOW | KW_ELEM_TYPE 
12c12
<     | KW_MAPJOIN | KW_MATERIALIZED | KW_METADATA | KW_MINUS | KW_MINUTE | KW_MONTH | KW_MSCK | KW_NOSCAN | KW_NO_DROP | KW_NULLS | KW_OFFLINE
---
>     | KW_MAPJOIN | KW_MATERIALIZED | KW_METADATA | KW_MINUTE | KW_MONTH | KW_MSCK | KW_NOSCAN | KW_NO_DROP | KW_NULLS | KW_OFFLINE
14c14
<     | KW_PRINCIPALS | KW_PROTECTION | KW_PURGE | KW_READ | KW_READONLY | KW_REBUILD | KW_RECORDREADER | KW_RECORDWRITER
---
>     | KW_PRINCIPALS | KW_PROTECTION | KW_PURGE | KW_QUARTER | KW_READ | KW_READONLY | KW_REBUILD | KW_RECORDREADER | KW_RECORDWRITER
20c20
<     | KW_UNSIGNED | KW_URI | KW_USE | KW_UTC | KW_UTCTIMESTAMP | KW_VALUE_TYPE | KW_VIEW | KW_WHILE | KW_YEAR
---
>     | KW_UNSIGNED | KW_URI | KW_USE | KW_UTC | KW_UTCTIMESTAMP | KW_VALUE_TYPE | KW_VIEW | KW_WEEK | KW_WHILE | KW_YEAR
32a33,36
>     | KW_MERGE
>     | KW_MATCHED
>     | KW_REPL | KW_DUMP | KW_BATCH | KW_STATUS
>     | KW_CACHE | KW_DAYOFWEEK | KW_VIEWS
38c42
<     KW_BIGINT | KW_BINARY | KW_BOOLEAN | KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_DATE | KW_DOUBLE | KW_FLOAT | KW_INT | KW_SMALLINT | KW_TIMESTAMP
---
>     KW_BIGINT | KW_BINARY | KW_BOOLEAN | KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_DATE | KW_DOUBLE | KW_FLOAT | KW_GROUPING | KW_INT | KW_SMALLINT | KW_TIMESTAMP

Summary.

  • Non-reserved
    • Removed: MERGE
    • Added: DETAIL, EXPRESSION, OPERATOR, SUMMARY, VECTORIZATION, WAIT
  • Reserved
    • Removed:
    • Added: MERGE

The list of changed keywords.

git checkout rel/release-2.2.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-2.2.0.txt
git checkout rel/release-2.3.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-2.3.0.txt
diff /tmp/keywords-2.2.0.txt /tmp/keywords-2.3.0.txt        
66a67
> KW_DETAIL: 'DETAIL';
86a88
> KW_EXPRESSION: 'EXPRESSION';
172a175
> KW_OPERATOR: 'OPERATOR';
250a254
> KW_SUMMARY: 'SUMMARY';
287a292
> KW_VECTORIZATION: 'VECTORIZATION';
289a295
> KW_WAIT: 'WAIT';

The list of non-reserved keywords.

git checkout rel/release-2.2.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-2.2.0.txt
git checkout rel/release-2.3.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-2.3.0.txt
diff /tmp/non-reserved-2.2.0.txt /tmp/non-reserved-2.3.0.txt 
33d32
<     | KW_MERGE
36a36,42
>     | KW_VECTORIZATION
>     | KW_SUMMARY
>     | KW_OPERATOR
>     | KW_EXPRESSION
>     | KW_DETAIL
>     | KW_WAIT
> 
39,40c45,46
< //The following SQL2011 reserved keywords are used as cast function name only, but not as identifiers.
< sql11ReservedKeywordsUsedAsCastFunctionName
---
> //The following SQL2011 reserved keywords are used as function name only, but not as identifiers.
> sql11ReservedKeywordsUsedAsFunctionName
42c48
<     KW_BIGINT | KW_BINARY | KW_BOOLEAN | KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_DATE | KW_DOUBLE | KW_FLOAT | KW_GROUPING | KW_INT | KW_SMALLINT | KW_TIMESTAMP
---
>     KW_IF | KW_ARRAY | KW_MAP | KW_BIGINT | KW_BINARY | KW_BOOLEAN | KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_DATE | KW_DOUBLE | KW_FLOAT | KW_GROUPING | KW_INT | KW_SMALLINT | KW_TIMESTAMP
44,64d49
< 
< //The following SQL2011 reserved keywords are used as identifiers in many q tests, they may be added back due to backward compatibility.
< //We are planning to remove the following whole list after several releases.
< //Thus, please do not change the following list unless you know what to do.
< sql11ReservedKeywordsUsedAsIdentifier
<     :
<     KW_ALL | KW_ALTER | KW_ARRAY | KW_AS | KW_AUTHORIZATION | KW_BETWEEN | KW_BIGINT | KW_BINARY | KW_BOOLEAN 
<     | KW_BOTH | KW_BY | KW_CREATE | KW_CUBE | KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_CURSOR | KW_DATE | KW_DECIMAL | KW_DELETE | KW_DESCRIBE 
<     | KW_DOUBLE | KW_DROP | KW_EXISTS | KW_EXTERNAL | KW_FALSE | KW_FETCH | KW_FLOAT | KW_FOR | KW_FULL | KW_GRANT 
<     | KW_GROUP | KW_GROUPING | KW_IMPORT | KW_IN | KW_INNER | KW_INSERT | KW_INT | KW_INTERSECT | KW_INTO | KW_IS | KW_LATERAL 
<     | KW_LEFT | KW_LIKE | KW_LOCAL | KW_NONE | KW_NULL | KW_OF | KW_ORDER | KW_OUT | KW_OUTER | KW_PARTITION 
<     | KW_PERCENT | KW_PROCEDURE | KW_RANGE | KW_READS | KW_REVOKE | KW_RIGHT 
<     | KW_ROLLUP | KW_ROW | KW_ROWS | KW_SET | KW_SMALLINT | KW_TABLE | KW_TIMESTAMP | KW_TO | KW_TRIGGER | KW_TRUE 
<     | KW_TRUNCATE | KW_UNION | KW_UPDATE | KW_USER | KW_USING | KW_VALUES | KW_WITH 
< //The following two keywords come from MySQL. Although they are not keywords in SQL2011, they are reserved keywords in MySQL.    
<     | KW_REGEXP | KW_RLIKE 
<     | KW_PRIMARY
<     | KW_FOREIGN
<     | KW_CONSTRAINT
<     | KW_REFERENCES
<     ;

Summary.

  • Non-reserved
    • Removed: PRETTY
    • Added: ACTIVATE, ACTIVE, ALLOC_FRACTION, CHECK, DEFAULT, DO, ENFORCED, KILL, MANAGEMENT, MAPPING, MOVE, PATH, PLAN, PLANS, POOL, QUERY, QUERY_PARALLELISM, REOPTIMIZATION, RESOURCE, SCHEDULING_POLICY, UNMANAGED, WORKLOAD, ZONE
  • Reserved
    • Removed: PARTIALSCAN
    • Added: ANY, APPLICATION, DEC, NUMERIC, SYNC, TIME, TIMESTAMPLOCALTZ, UNIQUE

The list of changed keywords.

git checkout rel/release-2.3.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-2.3.0.txt
git checkout rel/release-3.0.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-3.0.0.txt
diff /tmp/keywords-2.3.0.txt /tmp/keywords-3.0.0.txt        
1a2,3
> KW_ACTIVATE: 'ACTIVATE';
> KW_ACTIVE: 'ACTIVE';
5a8
> KW_ALLOC_FRACTION: 'ALLOC_FRACTION';
8a12,13
> KW_ANY : 'ANY';
> KW_APPLICATION: 'APPLICATION';
29a35
> KW_CHECK: 'CHECK';
59c65,66
< KW_DECIMAL: 'DECIMAL';
---
> KW_DECIMAL: 'DECIMAL' | 'DEC' | 'NUMERIC';
> KW_DEFAULT: 'DEFAULT';
72a80
> KW_DO: 'DO';
80a89
> KW_ENFORCED: 'ENFORCED';
136a146
> KW_KILL: 'KILL';
152a163
> KW_MANAGEMENT: 'MANAGEMENT';
154a166
> KW_MAPPING: 'MAPPING';
162a175
> KW_MOVE: 'MOVE';
186d198
< KW_PARTIALSCAN: 'PARTIALSCAN';
189a202
> KW_PATH: 'PATH';
190a204,205
> KW_PLAN: 'PLAN';
> KW_PLANS: 'PLANS';
191a207
> KW_POOL: 'POOL';
195d210
< KW_PRETTY: 'PRETTY';
200a216,217
> KW_QUERY: 'QUERY';
> KW_QUERY_PARALLELISM: 'QUERY_PARALLELISM';
212a230
> KW_REOPTIMIZATION: 'REOPTIMIZATION';
216a235
> KW_RESOURCE: 'RESOURCE';
227a247
> KW_SCHEDULING_POLICY: 'SCHEDULING_POLICY';
254a275
> KW_SYNC: 'SYNC';
261a283
> KW_TIME: 'TIME';
262a285
> KW_TIMESTAMPLOCALTZ: 'TIMESTAMPLOCALTZ';
276a300
> KW_UNIQUE: 'UNIQUE';
278a303
> KW_UNMANAGED: 'UNMANAGED';
302a328
> KW_WORKLOAD: 'WORKLOAD';
304a331
> KW_ZONE: 'ZONE';

The list of non-reserved words.

git checkout rel/release-2.3.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-2.3.0.txt
git checkout rel/release-3.0.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-3.0.0.txt
diff /tmp/non-reserved-2.3.0.txt /tmp/non-reserved-3.0.0.txt 
4c4
<     | KW_CASCADE | KW_CHANGE | KW_CLUSTER | KW_CLUSTERED | KW_CLUSTERSTATUS | KW_COLLECTION | KW_COLUMNS
---
>     | KW_CASCADE | KW_CHANGE | KW_CHECK | KW_CLUSTER | KW_CLUSTERED | KW_CLUSTERSTATUS | KW_COLLECTION | KW_COLUMNS
8c8
<     | KW_ENABLE | KW_ESCAPED | KW_EXCLUSIVE | KW_EXPLAIN | KW_EXPORT | KW_FIELDS | KW_FILE | KW_FILEFORMAT
---
>     | KW_ENABLE | KW_ENFORCED | KW_ESCAPED | KW_EXCLUSIVE | KW_EXPLAIN | KW_EXPORT | KW_FIELDS | KW_FILE | KW_FILEFORMAT
10c10
<     | KW_INDEX | KW_INDEXES | KW_INPATH | KW_INPUTDRIVER | KW_INPUTFORMAT | KW_ITEMS | KW_JAR
---
>     | KW_INDEX | KW_INDEXES | KW_INPATH | KW_INPUTDRIVER | KW_INPUTFORMAT | KW_ITEMS | KW_JAR | KW_KILL
13,14c13,14
<     | KW_OPTION | KW_OUTPUTDRIVER | KW_OUTPUTFORMAT | KW_OVERWRITE | KW_OWNER | KW_PARTITIONED | KW_PARTITIONS | KW_PLUS | KW_PRETTY
<     | KW_PRINCIPALS | KW_PROTECTION | KW_PURGE | KW_QUARTER | KW_READ | KW_READONLY | KW_REBUILD | KW_RECORDREADER | KW_RECORDWRITER
---
>     | KW_OPTION | KW_OUTPUTDRIVER | KW_OUTPUTFORMAT | KW_OVERWRITE | KW_OWNER | KW_PARTITIONED | KW_PARTITIONS | KW_PLUS
>     | KW_PRINCIPALS | KW_PROTECTION | KW_PURGE | KW_QUERY | KW_QUARTER | KW_READ | KW_READONLY | KW_REBUILD | KW_RECORDREADER | KW_RECORDWRITER
41a42,47
>     | KW_ZONE
>     | KW_TIMESTAMPTZ
>     | KW_DEFAULT
>     | KW_REOPTIMIZATION
>     | KW_RESOURCE | KW_PLAN | KW_PLANS | KW_QUERY_PARALLELISM | KW_ACTIVATE | KW_MOVE | KW_DO
>     | KW_POOL | KW_ALLOC_FRACTION | KW_SCHEDULING_POLICY | KW_PATH | KW_MAPPING | KW_WORKLOAD | KW_MANAGEMENT | KW_ACTIVE | KW_UNMANAGED

The list of changed keywords.

git checkout rel/release-3.0.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-3.0.0.txt
git checkout rel/release-3.1.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-3.1.0.txt
diff /tmp/keywords-3.0.0.txt /tmp/keywords-3.1.0.txt
(no diff)

The list of non-reserved words.

git checkout rel/release-3.0.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-3.0.0.txt
git checkout rel/release-3.1.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-3.1.0.txt
diff /tmp/non-reserved-3.0.0.txt /tmp/non-reserved-3.1.0.txt
(no diff)

Summary.

  • Non-reserved
    • Removed:
    • Added: AST, AT, BRANCH, CBO, COST, CRON, DCPROPERTIES, DEBUG, DISABLED, DISTRIBUTED, ENABLED, EVERY, EXECUTE, EXECUTED, EXPIRE_SNAPSHOTS, IGNORE, JOINCOST, MANAGED, MANAGEDLOCATION, OPTIMIZE, REMOTE, RESPECT, RETAIN, RETENTION, SCHEDULED, SET_CURRENT_SNAPSHOT, SNAPSHOTS, SPEC, SYSTEM_TIME, SYSTEM_VERSION, TAG, TRANSACTIONAL, TRIM, TYPE, UNKNOWN, URL, WITHIN
  • Reserved
    • Removed:
    • Added: COMPACTIONID, CONNECTOR, CONNECTORS, CONVERT, DDL, FORCE, LEADING, OLDER, PKFK_JOIN, PREPARE, QUALIFY, REAL, SOME, THAN, TRAILING

The list of changed keywords.

git checkout rel/release-3.1.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g| grep 'KW_' | sort > /tmp/keywords-3.1.0.txt
git checkout rel/release-4.0.0
cat parser/src/java/org/apache/hadoop/hive/ql/parse/HiveLexerParent.g| grep 'KW_' | sort > /tmp/keywords-4.0.0.txt
diff /tmp/keywords-3.1.0.txt /tmp/keywords-4.0.0.txt        
17a18,19
> KW_AST: 'AST';
> KW_AT: 'AT';
25a28
> KW_BRANCH: 'BRANCH';
32a36
> KW_CBO: 'CBO';
35a40
> KW_CHERRY_PICK: 'CHERRY-PICK';
45a51
> KW_COMPACT_ID: 'COMPACTIONID';
50a57,58
> KW_CONVERT: 'CONVERT';
> KW_COST: 'COST';
51a60
> KW_CRON: 'CRON';
60a70,71
> KW_DATACONNECTOR: 'CONNECTOR';
> KW_DATACONNECTORS: 'CONNECTORS';
64a76,78
> KW_DCPROPERTIES: 'DCPROPERTIES';
> KW_DDL: 'DDL';
> KW_DEBUG: 'DEBUG';
77c91
< KW_DISABLE: 'DISABLE';
---
> KW_DISABLE: 'DISABLE' | 'DISABLED';
79a94
> KW_DISTRIBUTED: 'DISTRIBUTED';
87c102
< KW_ENABLE: 'ENABLE';
---
> KW_ENABLE: 'ENABLE' | 'ENABLED';
90a106
> KW_EVERY: 'EVERY';
93a110,111
> KW_EXECUTE: 'EXECUTE';
> KW_EXECUTED: 'EXECUTED';
94a113
> KW_EXPIRE_SNAPSHOTS: 'EXPIRE_SNAPSHOTS';
101a121
> KW_FAST_FORWARD: 'FAST-FORWARD';
110a131
> KW_FORCE: 'FORCE';
124a146
> KW_IGNORE: 'IGNORE';
142a165
> KW_JOINCOST: 'JOINCOST';
148a172
> KW_LEADING: 'LEADING';
162a187,188
> KW_MANAGED: 'MANAGED';
> KW_MANAGEDLOCATION: 'MANAGEDLOCATION';
185a212
> KW_OLDER: 'OLDER';
188a216
> KW_OPTIMIZE: 'OPTIMIZE';
191a220
> KW_ORPHAN_FILES: 'ORPHAN-FILES';
203a233
> KW_PKFK_JOIN: 'PKFK_JOIN';
209a240
> KW_PREPARE: 'PREPARE';
214a246
> KW_QUALIFY : 'QUALIFY';
220a253
> KW_REAL: 'REAL';
228a262
> KW_REMOTE: 'REMOTE';
235a270
> KW_RESPECT: 'RESPECT';
236a272,273
> KW_RETAIN: 'RETAIN';
> KW_RETENTION: 'RETENTION';
246a284
> KW_SCHEDULED: 'SCHEDULED';
257a296
> KW_SET_CURRENT_SNAPSHOT: 'SET_CURRENT_SNAPSHOT';
263a303,304
> KW_SNAPSHOTS: 'SNAPSHOTS';
> KW_SOME : 'SOME';
265a307
> KW_SPEC: 'SPEC';
275a318,319
> KW_SYSTEM_TIME: 'SYSTEM_TIME';
> KW_SYSTEM_VERSION: 'SYSTEM_VERSION';
278a323
> KW_TAG: 'TAG';
281a327
> KW_THAN: 'THAN';
288a335
> KW_TRAILING: 'TRAILING';
289a337
> KW_TRANSACTIONAL: 'TRANSACTIONAL';
292a341
> KW_TRIM: 'TRIM';
294a344
> KW_TYPE: 'TYPE';
301a352
> KW_UNKNOWN : 'UNKNOWN';
307a359
> KW_URL: 'URL';
326a379
> KW_WITHIN: 'WITHIN';

The list of non-reserved words.

git checkout rel/release-3.1.0
cat ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-3.1.0.txt
git checkout rel/release-4.0.0
cat parser/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g | sed -n '/^nonReserved/,$p' > /tmp/non-reserved-4.0.0.txt
diff /tmp/non-reserved-3.1.0.txt /tmp/non-reserved-4.0.0.txt 
4,7c4,7
<     | KW_CASCADE | KW_CHANGE | KW_CHECK | KW_CLUSTER | KW_CLUSTERED | KW_CLUSTERSTATUS | KW_COLLECTION | KW_COLUMNS
<     | KW_COMMENT | KW_COMPACT | KW_COMPACTIONS | KW_COMPUTE | KW_CONCATENATE | KW_CONTINUE | KW_DATA | KW_DAY
<     | KW_DATABASES | KW_DATETIME | KW_DBPROPERTIES | KW_DEFERRED | KW_DEFINED | KW_DELIMITED | KW_DEPENDENCY 
<     | KW_DESC | KW_DIRECTORIES | KW_DIRECTORY | KW_DISABLE | KW_DISTRIBUTE | KW_DOW | KW_ELEM_TYPE 
---
>     | KW_CASCADE | KW_CBO | KW_CHANGE | KW_CHECK | KW_CLUSTER | KW_CLUSTERED | KW_CLUSTERSTATUS | KW_COLLECTION | KW_COLUMNS
>     | KW_COMMENT | KW_COMPACT | KW_COMPACTIONS | KW_COMPUTE | KW_CONCATENATE | KW_CONTINUE | KW_COST | KW_DATA | KW_DAY
>     | KW_DATABASES | KW_DATETIME | KW_DBPROPERTIES | KW_DCPROPERTIES | KW_DEFERRED | KW_DEFINED | KW_DELIMITED | KW_DEPENDENCY
>     | KW_DESC | KW_DIRECTORIES | KW_DIRECTORY | KW_DISABLE | KW_DISTRIBUTE | KW_DISTRIBUTED | KW_DOW | KW_ELEM_TYPE
9,12c9,12
<     | KW_FIRST | KW_FORMAT | KW_FORMATTED | KW_FUNCTIONS | KW_HOLD_DDLTIME | KW_HOUR | KW_IDXPROPERTIES | KW_IGNORE
<     | KW_INDEX | KW_INDEXES | KW_INPATH | KW_INPUTDRIVER | KW_INPUTFORMAT | KW_ITEMS | KW_JAR | KW_KILL
<     | KW_KEYS | KW_KEY_TYPE | KW_LAST | KW_LIMIT | KW_OFFSET | KW_LINES | KW_LOAD | KW_LOCATION | KW_LOCK | KW_LOCKS | KW_LOGICAL | KW_LONG
<     | KW_MAPJOIN | KW_MATERIALIZED | KW_METADATA | KW_MINUTE | KW_MONTH | KW_MSCK | KW_NOSCAN | KW_NO_DROP | KW_NULLS | KW_OFFLINE
---
>     | KW_FIRST | KW_FORMAT | KW_FORMATTED | KW_FUNCTIONS | KW_HOLD_DDLTIME | KW_HOUR | KW_IDXPROPERTIES | KW_RESPECT | KW_IGNORE
>     | KW_INDEX | KW_INDEXES | KW_INPATH | KW_INPUTDRIVER | KW_INPUTFORMAT | KW_ITEMS | KW_JAR | KW_JOINCOST | KW_KILL
>     | KW_KEYS | KW_KEY_TYPE | KW_LAST | KW_LIMIT | KW_OFFSET | KW_LINES | KW_LOAD | KW_LOCATION | KW_LOCK | KW_LOCKS | KW_LOGICAL | KW_LONG | KW_MANAGED
>     | KW_MANAGEDLOCATION | KW_MAPJOIN | KW_MATERIALIZED | KW_METADATA | KW_MINUTE | KW_MONTH | KW_MSCK | KW_NOSCAN | KW_NO_DROP | KW_NULLS | KW_OFFLINE
15c15
<     | KW_RELOAD | KW_RENAME | KW_REPAIR | KW_REPLACE | KW_REPLICATION | KW_RESTRICT | KW_REWRITE
---
>     | KW_RELOAD | KW_REMOTE | KW_RENAME | KW_REPAIR | KW_REPLACE | KW_REPLICATION | KW_RESTRICT | KW_REWRITE
17c17
<     | KW_SHOW | KW_SHOW_DATABASE | KW_SKEWED | KW_SORT | KW_SORTED | KW_SSL | KW_STATISTICS | KW_STORED
---
>     | KW_SHOW | KW_SHOW_DATABASE | KW_SKEWED | KW_SORT | KW_SORTED | KW_SSL | KW_STATISTICS | KW_STORED | KW_AST
19,20c19,20
<     | KW_TINYINT | KW_TOUCH | KW_TRANSACTIONS | KW_UNARCHIVE | KW_UNDO | KW_UNIONTYPE | KW_UNLOCK | KW_UNSET
<     | KW_UNSIGNED | KW_URI | KW_USE | KW_UTC | KW_UTCTIMESTAMP | KW_VALUE_TYPE | KW_VIEW | KW_WEEK | KW_WHILE | KW_YEAR
---
>     | KW_TINYINT | KW_TOUCH | KW_TRANSACTIONAL | KW_TRANSACTIONS | KW_TYPE | KW_UNARCHIVE | KW_UNDO | KW_UNIONTYPE | KW_UNLOCK | KW_UNSET
>     | KW_UNSIGNED | KW_URI | KW_URL | KW_USE | KW_UTC | KW_UTCTIMESTAMP | KW_VALUE_TYPE | KW_VIEW | KW_WEEK | KW_WHILE | KW_YEAR
40a41
>     | KW_DEBUG
45a47
>     | KW_EXECUTED | KW_SCHEDULED | KW_CRON | KW_EVERY | KW_AT | KW_EXECUTE
48c50,60
< 
---
>     | KW_UNKNOWN
>     | KW_WITHIN
>     | KW_TRIM
>     | KW_SPEC
>     | KW_SYSTEM_TIME | KW_SYSTEM_VERSION
>     | KW_EXPIRE_SNAPSHOTS
>     | KW_SET_CURRENT_SNAPSHOT
>     | KW_BRANCH | KW_SNAPSHOTS | KW_RETAIN | KW_RETENTION
>     | KW_TAG
>     | KW_FAST_FORWARD
>     | KW_OPTIMIZE
54c66
<     KW_IF | KW_ARRAY | KW_MAP | KW_BIGINT | KW_BINARY | KW_BOOLEAN | KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_DATE | KW_DOUBLE | KW_FLOAT | KW_GROUPING | KW_INT | KW_SMALLINT | KW_TIMESTAMP
---
>     KW_IF | KW_ARRAY | KW_MAP | KW_BIGINT | KW_BINARY | KW_BOOLEAN | KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_DATE | KW_DOUBLE | KW_FLOAT | KW_REAL | KW_GROUPING | KW_INT | KW_SMALLINT | KW_TIMESTAMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment