You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vg...@apache.org on 2018/08/07 19:36:39 UTC
hive git commit: HIVE-20326: Create constraints with RELY as default
instead of NO RELY (Vineet Garg, reviewed by Jesus Camacho Rodriguez)
Repository: hive
Updated Branches:
refs/heads/master d4a8625d5 -> c0f63bf0c
HIVE-20326: Create constraints with RELY as default instead of NO RELY (Vineet Garg, reviewed by Jesus Camacho Rodriguez)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/c0f63bf0
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/c0f63bf0
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/c0f63bf0
Branch: refs/heads/master
Commit: c0f63bf0c84fb269c45cc5b7e337d72f857d9231
Parents: d4a8625
Author: Vineet Garg <vg...@apache.org>
Authored: Tue Aug 7 12:35:59 2018 -0700
Committer: Vineet Garg <vg...@apache.org>
Committed: Tue Aug 7 12:35:59 2018 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java | 5 +++--
ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/c0f63bf0/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
index 40039ac..e3fa379 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
@@ -998,10 +998,10 @@ public abstract class BaseSemanticAnalyzer {
// Default values
String constraintName = null;
//by default if user hasn't provided any optional constraint properties
- // it will be considered ENABLE and NOVALIDATE and RELY=false
+ // it will be considered ENABLE and NOVALIDATE and RELY=true
boolean enable = true;
boolean validate = false;
- boolean rely = false;
+ boolean rely = true;
String checkOrDefaultValue = null;
for (int i = 0; i < child.getChildCount(); i++) {
ASTNode grandChild = (ASTNode) child.getChild(i);
@@ -1018,6 +1018,7 @@ public abstract class BaseSemanticAnalyzer {
enable = false;
// validate is false by default if we disable the constraint
validate = false;
+ rely = false;
} else if (type == HiveParser.TOK_VALIDATE) {
validate = true;
} else if (type == HiveParser.TOK_NOVALIDATE) {
http://git-wip-us.apache.org/repos/asf/hive/blob/c0f63bf0/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
index d581c60..f4d12ae 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
@@ -2252,7 +2252,7 @@ relySpecification
@init { pushMsg("rely specification", state); }
@after { popMsg(state); }
: KW_RELY -> ^(TOK_RELY)
- | (KW_NORELY)? -> ^(TOK_NORELY)
+ | KW_NORELY -> ^(TOK_NORELY)
;
createConstraint
@@ -2508,11 +2508,11 @@ tableConstraintType
;
constraintOptsCreate
- : enableValidateSpecification relySpecification
+ : enableValidateSpecification relySpecification?
;
constraintOptsAlter
- : enableValidateSpecification relySpecification
+ : enableValidateSpecification relySpecification?
;
columnNameColonType