Repository: hive
Updated Branches:
  refs/heads/branch-1 425273eed -> d9b5d5322


HIVE-11348: Support START TRANSACTION/COMMIT/ROLLBACK commands: support SQL2011 
reserved keywords (Pengcheng Xiong reviewed by Eugene Koifman)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/d9b5d532
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d9b5d532
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d9b5d532

Branch: refs/heads/branch-1
Commit: d9b5d5322b8c93d56888f25d5bab473d6fe295b7
Parents: 425273e
Author: Pengcheng Xiong <pxi...@apache.org>
Authored: Wed Aug 12 10:04:54 2015 -0700
Committer: Pengcheng Xiong <pxi...@apache.org>
Committed: Wed Aug 12 11:11:18 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/parse/IdentifiersParser.g | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/d9b5d532/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
index 501287d..64af7d1 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
@@ -614,7 +614,13 @@ principalIdentifier
     | QuotedIdentifier
     ;
 
-//the new version of nonReserved + sql11ReservedKeywordsUsedAsIdentifier = old 
version of nonReserved 
+//The new version of nonReserved + sql11ReservedKeywordsUsedAsIdentifier = old 
version of nonReserved
+//Non reserved keywords are basically the keywords that can be used as 
identifiers.
+//All the KW_* are automatically not only keywords, but also reserved keywords.
+//That means, they can NOT be used as identifiers.
+//If you would like to use them as identifiers, put them in the nonReserved 
list below.
+//If you are not sure, please refer to the SQL2011 column in
+//http://www.postgresql.org/docs/9.5/static/sql-keywords-appendix.html
 nonReserved
     :
     KW_ADD | KW_ADMIN | KW_AFTER | KW_ANALYZE | KW_ARCHIVE | KW_ASC | 
KW_BEFORE | KW_BUCKET | KW_BUCKETS
@@ -636,11 +642,7 @@ nonReserved
     | 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_WHILE | KW_YEAR
     | KW_WORK
-    | KW_START
     | KW_TRANSACTION
-    | KW_COMMIT
-    | KW_ROLLBACK
-    | KW_ONLY
     | KW_WRITE
     | KW_ISOLATION
     | KW_LEVEL
@@ -648,13 +650,15 @@ nonReserved
     | KW_AUTOCOMMIT
 ;
 
-//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.
 sql11ReservedKeywordsUsedAsCastFunctionName
     :
     KW_BIGINT | KW_BINARY | KW_BOOLEAN | KW_CURRENT_DATE | 
KW_CURRENT_TIMESTAMP | KW_DATE | KW_DOUBLE | KW_FLOAT | KW_INT | KW_SMALLINT | 
KW_TIMESTAMP
     ;
 
 //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 

Reply via email to