deniskuzZ commented on code in PR #6988:
URL: https://github.com/apache/hive/pull/6988#discussion_r4753364685


##########
ql/src/test/queries/clientpositive/aggregate_join_transpose_unique.q:
##########
@@ -0,0 +1,20 @@
+-- SORT_QUERY_RESULTS
+
+create table ajt_dim (x int, k int, y int, primary key (k) disable novalidate 
rely);
+create table ajt_dim_nopk (k int, x int);
+create table ajt_fact (fk int);
+insert into ajt_dim values (10, 1, 100), (20, 2, 200), (null, 3, 300);
+insert into ajt_dim_nopk values (1, 10), (2, 20), (3, null);
+insert into ajt_fact values (1), (1), (2), (3), (3), (3);
+
+explain cbo
+select k, sum(x), min(x), max(x), count(x), count(*) from ajt_dim join 
ajt_fact on k = fk group by k;
+select k, sum(x), min(x), max(x), count(x), count(*) from ajt_dim join 
ajt_fact on k = fk group by k;

Review Comment:
   All cases have the unique side (ajt_dim) on the left, so the unique branch 
only runs with s == 0 / identity mapping. 
   Could you add the mirrored query, ... from ajt_fact join ajt_dim on fk = k 
group by k, so the s == 1 shift mapping is covered? 
   Please also check in explain cbo that ajt_dim stays on the right.
   
   ````
   explain cbo
   select k, sum(x), min(x), max(x), count(x), count(*) from ajt_fact join 
ajt_dim on fk = k group by k;
   select k, sum(x), min(x), max(x), count(x), count(*) from ajt_fact join 
ajt_dim on fk = k group by k;
   ````



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