soumyakanti3578 commented on a change in pull request #2777:
URL: https://github.com/apache/hive/pull/2777#discussion_r758698228
##########
File path: ql/src/test/queries/clientpositive/show_create_table.q
##########
@@ -0,0 +1,44 @@
+CREATE TABLE TEST(
+ col1 varchar(100) NOT NULL COMMENT "comment for column 1",
+ col2 timestamp DEFAULT CURRENT_TIMESTAMP() COMMENT "comment for column 2",
+ col3 decimal CHECK (col3 + col4 > 1) enable novalidate rely,
+ col4 decimal NOT NULL,
+ col5 varchar(100),
+ primary key(col1, col2) disable novalidate rely,
+ constraint c3_c4_check CHECK((col3 + col4)/(col3 - col4) > 3),
+ constraint c4_unique UNIQUE(col4) disable novalidate rely)
+ROW FORMAT SERDE
+ 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
+STORED AS INPUTFORMAT
+ 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
+OUTPUTFORMAT
+ 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
+
+CREATE TABLE TEST2(
+ col varchar(100),
+ primary key(col) disable novalidate rely)
+ROW FORMAT SERDE
+'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
+STORED AS INPUTFORMAT
+'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
+OUTPUTFORMAT
+'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
+
+CREATE TABLE TEST3(
+ col1 varchar(100) COMMENT "comment",
+ col2 timestamp,
+ col3 varchar(100),
+ foreign key(col1, col2) references TEST(col1, col2) disable novalidate rely,
+ foreign key(col3) references TEST2(col) disable novalidate rely)
Review comment:
I couldn't find a way to add `enable validate norely` to any constraint.
I think `validate` is not supported yet, because I keep getting
`org.apache.hadoop.hive.ql.parse.SemanticException: Invalid Foreign Key syntax
VALIDATE feature not supported yet. Please use NOVALIDATE instead.`
Also, I consulted the language manual -
https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl#LanguageManualDDL-CreateTableCreate/Drop/TruncateTable
- where I couldn't find an example with `validate`.
Do let me know if you have a suggestion!
--
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]