kasakrisz commented on code in PR #4478:
URL: https://github.com/apache/hive/pull/4478#discussion_r1266706545


##########
ql/src/test/queries/clientpositive/join_using_clause.q:
##########
@@ -0,0 +1,69 @@
+
+create table test (
+ a int
+);
+
+insert into test values (1);
+
+create table test1 (
+ a int,
+ b int
+);
+
+insert into test1 values (1, 2);
+
+create table test2 (
+ a int,
+ b int,
+ c int
+);
+
+insert into test2 values (1, 2, 3);
+
+-- self join with 1 column
+select * from test t1
+join test t2 using(a)
+join test t3 using(a);
+
+explain extended select * from test t1
+join test t2 using(a)
+join test t3 using(a);
+
+-- self join with multiple columns
+select * from test1 t1
+join test1 t2 using(a)
+join test1 t3 using(b);
+
+explain extended select * from test1 t1
+join test1 t2 using(a)
+join test1 t3 using(b);
+
+-- joins with multiple tables and columns
+select * from test t1
+join test1 t2 using(a)
+join test2 t3 using(b);
+
+explain extended select * from test t1
+join test1 t2 using(a)
+join test2 t3 using(b);
+
+select * from test t1
+join test1 t2 using(a)
+join test2 t3 using(b)
+join test2 t4 using(c);
+
+explain extended select * from test t1
+join test1 t2 using(a)
+join test2 t3 using(b)
+join test2 t4 using(c);
+
+select * from test1 t1
+join test2 t2 using(a, b)
+join test2 t3 using(c, b)
+join test t4 using(a);
+
+explain extended select * from test1 t1
+join test2 t2 using(a, b)
+join test2 t3 using(c, b)
+join test t4 using(a);
+

Review Comment:
   Is NPE thrown when no aliases specified?
   ```
   explain extended select * from test1
   join test2 using(a, b)
   join test using(c, b)
   ```



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