| ==== |
| ---- QUERY |
| #################################################### |
| # Test case 1: bloom filters with high expected FP rate get disabled. |
| # To trigger this path, we limit the size of the filter to a much lower value than |
| # required to achieve the desired FP rate. |
| #################################################### |
| |
| SET RUNTIME_FILTER_WAIT_TIME_MS=30000; |
| SET RUNTIME_FILTER_MODE=GLOBAL; |
| SET RUNTIME_FILTER_MAX_SIZE=64K; |
| with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem) |
| select STRAIGHT_JOIN count(*) from (select * from tpch.lineitem a LIMIT 1) a |
| join (select * from l LIMIT 500000) b on a.l_orderkey = -b.l_orderkey; |
| ---- RESULTS |
| 0 |
| ---- RUNTIME_PROFILE |
| row_regex: .*0 of 1 Runtime Filter Published, 1 Disabled.* |
| ==== |
| |
| |
| ---- QUERY |
| #################################################### |
| # Test case 2: Filter sizes change according to their NDV |
| #################################################### |
| SET RUNTIME_FILTER_MODE=GLOBAL; |
| SET RUNTIME_FILTER_WAIT_TIME_MS=30000; |
| SET RUNTIME_FILTER_MIN_SIZE=64KB; |
| with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem) |
| select STRAIGHT_JOIN count(*) from (select * from tpch.lineitem a LIMIT 1) a |
| join (select * from l LIMIT 125000) b on a.l_orderkey = -b.l_orderkey; |
| ---- RESULTS |
| 0 |
| ---- RUNTIME_PROFILE |
| row_regex: .*1 of 1 Runtime Filter Published.* |
| row_regex: .*Filter 0 \(64.00 KB\).* |
| ==== |
| ---- QUERY |
| SET RUNTIME_FILTER_MODE=GLOBAL; |
| SET RUNTIME_FILTER_WAIT_TIME_MS=30000; |
| SET RUNTIME_FILTER_MIN_SIZE=64KB; |
| with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem) |
| select STRAIGHT_JOIN count(*) from (select * from tpch.lineitem a LIMIT 1) a |
| join (select * from l LIMIT 500000) b on a.l_orderkey = -b.l_orderkey; |
| ---- RESULTS |
| 0 |
| ---- RUNTIME_PROFILE |
| row_regex: .*1 of 1 Runtime Filter Published.* |
| row_regex: .*Filter 0 \(256.00 KB\).* |
| ==== |
| ---- QUERY |
| SET RUNTIME_FILTER_MODE=GLOBAL; |
| SET RUNTIME_FILTER_WAIT_TIME_MS=30000; |
| SET RUNTIME_FILTER_MIN_SIZE=64KB; |
| with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem) |
| select STRAIGHT_JOIN count(*) from (select * from tpch.lineitem a LIMIT 1) a |
| join (select * from l LIMIT 1000000) b on a.l_orderkey = -b.l_orderkey; |
| ---- RESULTS |
| 0 |
| ---- RUNTIME_PROFILE |
| row_regex: .*1 of 1 Runtime Filter Published.* |
| row_regex: .*Filter 0 \(512.00 KB\).* |
| ==== |
| ---- QUERY |
| SET RUNTIME_FILTER_MODE=GLOBAL; |
| SET RUNTIME_FILTER_WAIT_TIME_MS=30000; |
| SET RUNTIME_FILTER_MIN_SIZE=64KB; |
| with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem) |
| select STRAIGHT_JOIN count(*) from (select * from tpch.lineitem a LIMIT 1) a |
| join (select * from l LIMIT 2000000) b on a.l_orderkey = -b.l_orderkey; |
| ---- RESULTS |
| 0 |
| ---- RUNTIME_PROFILE |
| row_regex: .*1 of 1 Runtime Filter Published.* |
| row_regex: .*Filter 0 \(1.00 MB\).* |
| ==== |
| |
| |
| |
| ---- QUERY |
| #################################################### |
| # Test case 3: Filter sizes respect query options |
| #################################################### |
| SET RUNTIME_FILTER_MODE=GLOBAL; |
| SET RUNTIME_FILTER_WAIT_TIME_MS=30000; |
| SET RUNTIME_FILTER_MIN_SIZE=128KB; |
| SET RUNTIME_FILTER_MAX_SIZE=128KB; |
| # This query would produce a 64KB filter without setting the minimum size. |
| select STRAIGHT_JOIN count(*) from alltypes a join [SHUFFLE] alltypes b on a.id = b.id; |
| ---- RESULTS |
| 7300 |
| ---- RUNTIME_PROFILE |
| row_regex: .*1 of 1 Runtime Filter Published.* |
| row_regex: .*Filter 0 \(128.00 KB\).* |
| ==== |
| ---- QUERY |
| # Check that filter sizes are rounded up to power-of-two |
| SET RUNTIME_FILTER_MIN_SIZE=80000B; |
| SET RUNTIME_FILTER_MAX_SIZE=80000B; |
| select STRAIGHT_JOIN count(*) from alltypes a join [SHUFFLE] alltypes b on a.id = b.id; |
| ---- RESULTS |
| 7300 |
| ---- RUNTIME_PROFILE |
| row_regex: .*1 of 1 Runtime Filter Published.* |
| row_regex: .*Filter 0 \(128.00 KB\).* |
| ==== |
| ---- QUERY |
| SET RUNTIME_FILTER_MODE=GLOBAL; |
| SET RUNTIME_FILTER_WAIT_TIME_MS=30000; |
| SET RUNTIME_FILTER_MAX_SIZE=64KB; |
| # Query would produce a 512KB filter without setting the max |
| with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem) |
| select STRAIGHT_JOIN count(*) from (select * from tpch.lineitem a LIMIT 1) a |
| join (select * from l LIMIT 1000000) b on a.l_orderkey = -b.l_orderkey; |
| ---- RUNTIME_PROFILE |
| row_regex: .*0 of 1 Runtime Filter Published.* |
| row_regex: .*Filter 0 \(64.00 KB\).* |
| ==== |
| |
| |
| |
| ---- QUERY |
| #################################################### |
| # Test case 4: Filter size is >= the min buffer size that can be allocated by the |
| # buffer pool |
| #################################################### |
| SET RUNTIME_FILTER_MODE=GLOBAL; |
| SET RUNTIME_FILTER_WAIT_TIME_MS=30000; |
| SET RUNTIME_FILTER_MIN_SIZE=4KB; |
| SET RUNTIME_BLOOM_FILTER_SIZE=4KB; |
| SET DISABLE_HDFS_NUM_ROWS_ESTIMATE=1; |
| # The min buffer size is set to 8KB for end to end tests. This query would |
| # produce a 4KB filter if the min buffer size limit bound is not enforced. |
| select STRAIGHT_JOIN count(*) from alltypes a join [SHUFFLE] alltypes b on a.id = b.id; |
| ---- RESULTS |
| 7300 |
| ---- RUNTIME_PROFILE |
| row_regex: .*1 of 1 Runtime Filter Published.* |
| row_regex: .*Filter 0 \(8.00 KB\).* |
| ==== |