ayushtkn commented on code in PR #6563:
URL: https://github.com/apache/hive/pull/6563#discussion_r3478082821


##########
ql/src/test/queries/clientpositive/show_create_table_tab_view.q:
##########
@@ -0,0 +1,46 @@
+-- Test SHOW CREATE TABLE when view is expanded text contains a tab 
(HIVE-29059).
+-- IDE may replace tabs with spaces during edit. 
+-- This test qfile requires actual tabs instead of soft tabs/spaces to 
function properly
+
+DROP VIEW IF EXISTS hive_29059_v;
+DROP VIEW IF EXISTS hive_29059_v2;
+DROP VIEW IF EXISTS hive_29059_v3;
+DROP VIEW IF EXISTS hive_29059_v4;
+DROP VIEW IF EXISTS hive_29059_v5;
+DROP TABLE IF EXISTS hive_29059_src;
+CREATE TABLE hive_29059_src (val1 string COMMENT 'val  1', 
+                             val2 string COMMENT 'val
+                                                2', 
+                             val3 string);
+INSERT INTO hive_29059_src VALUES ('a1', 'b1', 'c1');
+
+-- Create view from source table with tab in the WHERE clause
+CREATE VIEW hive_29059_v AS SELECT * FROM hive_29059_src 
+       WHERE val1      = 'a1'
+       AND val2        = 'b1';
+SHOW CREATE TABLE hive_29059_v;
+
+-- Make sure show create table for non-view tables don't break
+SHOW CREATE TABLE hive_29059_src;
+
+-- Create view with TAB in string literal
+CREATE VIEW hive_29059_v2 AS SELECT 'before
+       after' AS col1;
+SHOW CREATE TABLE hive_29059_v2;
+
+CREATE VIEW hive_29059_v3 AS SELECT '  a               b       c               
' AS col1;
+SHOW CREATE TABLE hive_29059_v3;
+
+CREATE VIEW hive_29059_v4 AS SELECT 'a\\tb\tc' AS col1;
+SHOW CREATE TABLE hive_29059_v4;
+
+CREATE VIEW hive_29059_v5 AS SELECT val1 FROM hive_29059_src WHERE val1 LIKE 
'a%       ';
+SHOW CREATE TABLE hive_29059_v5;
+
+
+DROP VIEW IF EXISTS hive_29059_v;
+DROP VIEW IF EXISTS hive_29059_v2;
+DROP VIEW IF EXISTS hive_29059_v3;
+DROP VIEW IF EXISTS hive_29059_v4;
+DROP VIEW IF EXISTS hive_29059_v5;
+DROP TABLE IF EXISTS hive_29059_src;

Review Comment:
   I don't think these drops are required, the framework takes care of dropping 
all the table, maybe we can get rid of these here and above



##########
ql/src/test/queries/clientpositive/show_create_table_tab_view.q:
##########
@@ -0,0 +1,46 @@
+-- Test SHOW CREATE TABLE when view is expanded text contains a tab 
(HIVE-29059).
+-- IDE may replace tabs with spaces during edit. 
+-- This test qfile requires actual tabs instead of soft tabs/spaces to 
function properly
+
+DROP VIEW IF EXISTS hive_29059_v;
+DROP VIEW IF EXISTS hive_29059_v2;
+DROP VIEW IF EXISTS hive_29059_v3;
+DROP VIEW IF EXISTS hive_29059_v4;
+DROP VIEW IF EXISTS hive_29059_v5;
+DROP TABLE IF EXISTS hive_29059_src;
+CREATE TABLE hive_29059_src (val1 string COMMENT 'val  1', 
+                             val2 string COMMENT 'val
+                                                2', 
+                             val3 string);
+INSERT INTO hive_29059_src VALUES ('a1', 'b1', 'c1');
+
+-- Create view from source table with tab in the WHERE clause
+CREATE VIEW hive_29059_v AS SELECT * FROM hive_29059_src 

Review Comment:
   we should use some better name rather than the jira id



##########
ql/src/test/queries/clientpositive/show_create_table_tab_view.q:
##########
@@ -0,0 +1,46 @@
+-- Test SHOW CREATE TABLE when view is expanded text contains a tab 
(HIVE-29059).
+-- IDE may replace tabs with spaces during edit. 
+-- This test qfile requires actual tabs instead of soft tabs/spaces to 
function properly

Review Comment:
   this all isn't required



-- 
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]

Reply via email to