dantongdong commented on a change in pull request #2389:
URL: https://github.com/apache/hive/pull/2389#discussion_r652014451
##########
File path: parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
##########
@@ -1156,7 +1156,7 @@ createDatabaseStatement
dbManagedLocation?
dbConnectorName?
(KW_WITH KW_DBPROPERTIES dbprops=dbProperties)?
- -> {$remote != null}? ^(TOK_CREATEDATABASE $name ifNotExists?
databaseComment? $dbprops? dbConnectorName?)
+ -> {$remote != null}? ^(TOK_CREATEDATABASE $name ifNotExists? dbLocation?
dbManagedLocation? databaseComment? $dbprops? dbConnectorName?)
Review comment:
It doesn't throw an exception because this line is not in charge of the
actual parsing and compiling. This line is in charge of generating ASTNode
based on the pared and compiled result. Not including dbLocation and
dbManagedLocation in this line will only make it ignore dbLocation and
dbManaged when generating ASTNode. The actual parsing and compiling is done in
the lines above it(line1131-1139). All the create database statement shares the
same parse and compile code, which means that all create database(including
remote)statement will parse and compile dbLocation and dbManagedLocation.
Likewise, if you do something like: "create database localdb using connector
xyz" will not throw an error neither. I can also fix this if it is not desired
behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]