wecharyu commented on code in PR #3360:
URL: https://github.com/apache/hive/pull/3360#discussion_r899213697
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/function/create/CreateFunctionAnalyzer.java:
##########
@@ -54,6 +54,14 @@ public CreateFunctionAnalyzer(QueryState queryState) throws
SemanticException {
public void analyzeInternal(ASTNode root) throws SemanticException {
String functionName = root.getChild(0).getText().toLowerCase();
boolean isTemporary =
(root.getFirstChildWithType(HiveParser.TOK_TEMPORARY) != null);
+ boolean replace = (root.getFirstChildWithType(HiveParser.TOK_ORREPLACE) !=
null);
+ boolean ifNotExists =
(root.getFirstChildWithType(HiveParser.TOK_IFNOTEXISTS) != null);
+ if (ifNotExists && replace) {
+ throw new SemanticException("CREATE FUNCTION with both IF NOT EXISTS and
REPLACE is not allowed.");
Review Comment:
Both syntaxes look good to me, currently this syntax is just similar to
Spark.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]