Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
garenshi committed Jan 8, 2025
1 parent ed41588 commit 2af0a05
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ suite("distinct_split") {
qt_111_five """select count(distinct a,b), count(distinct a,c) , count(distinct a,d), count(distinct c) , count(distinct a,b,c,d) from test_distinct_multi group by e order by 1,2,3,4,5"""
qt_111_three_gby_multi """select count(distinct a,b), count(distinct a,c) , count(distinct a) from test_distinct_multi group by c,a order by 1,2,3"""
qt_111_four_gby_multi """select count(distinct a,b), count(distinct a,c) , count(distinct a), count(distinct c) from test_distinct_multi group by e,a,b order by 1,2,3,4"""
qt_111_five_gby_multi """select count(distinct a,b), count(distinct a,c) , count(distinct a,d), count(distinct c) , count(distinct a,b,c,d) from test_distinct_multi group by e,a,b,c,d order by 1,2,3,4,5"""

def aa = sql """explain select count(distinct a,b), count(distinct a,c) , count(distinct a,d), count(distinct c) , count(distinct a,b,c,d) from test_distinct_multi group by e,a,b,c,d order by 1,2,3,4,5"""

logger.info("=====null hash jon ==== : \n" + aa)

qt_111_five_gby_multi """select count(distinct a,b), count(distinct a,c) , count(distinct a,d), count(distinct c) , count(distinct a,b,c,d) from test_distinct_multi group by e,a,b,c,d order by 1,2,3,4,5"""
// sum has two dimensions: 1. Is there one or more projection columns (0 for one, 1 for more) 2. Is there a group by (0 for none, 1 for yes)
qt_00_sum """select sum(distinct b) from test_distinct_multi"""
qt_10_sum """select sum(distinct b), sum(distinct a) from test_distinct_multi"""
Expand Down Expand Up @@ -211,6 +215,5 @@ suite("distinct_split") {
//----------------test null hash join ------------------------
sql "truncate table test_distinct_multi;"
sql "insert into test_distinct_multi values(1,null,null,null,'2024-12-08');"
qt_null_hash "SELECT a, b, count(distinct c,e), count(distinct concat(d,e))/count(distinct e) FROM test_distinct_multi where e = '2024-12-08' GROUP BY a, b"

qt_null_hash "SELECT a, b, count(distinct c,e), count(distinct concat(d,e))/count(distinct e) FROM test_distinct_multi where e = '2024-12-08' GROUP BY a, b;"
}

0 comments on commit 2af0a05

Please sign in to comment.