kasakrisz commented on code in PR #6988: URL: https://github.com/apache/hive/pull/6988#discussion_r4754590120
########## 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; + +explain cbo +select k, y, sum(x), sum(y) from ajt_dim join ajt_fact on k = fk group by k, y; +select k, y, sum(x), sum(y) from ajt_dim join ajt_fact on k = fk group by k, y; + +explain cbo +select d.k, sum(d.x) from (select k, max(x) x from ajt_dim_nopk group by k) d join ajt_fact on d.k = fk group by d.k; +select d.k, sum(d.x) from (select k, max(x) x from ajt_dim_nopk group by k) d join ajt_fact on d.k = fk group by d.k; Review Comment: I run the queries with the rule tuned off entirely locally and compared the results. However I didn't add those statements to the test to save some test infra resources. If a golden file is regenerated the changes should show-up in the PR. -- 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]
