mirror of
https://github.com/apache/impala.git
synced 2026-01-04 09:00:56 -05:00
I wrote these tests for my IMPALA-3987 patch, but other issues block that optimisations. These tests exercise an interesting corner case so I split them out into a separate patch. The functional tests exercise every join mode for nested loop join and hash join with an empty build side. The perf test exercises hash join with an empty build side. Testing: Made sure the tests passed with both partitioned and non-partitioned hash join implementations. Ran the targeted perf query through the single node perf run script to make sure it worked. Change-Id: I0a68cafec32011a47c569b254979601237e7f2a5 Reviewed-on: http://gerrit.cloudera.org:8080/4051 Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com> Tested-by: Internal Jenkins
193 lines
3.5 KiB
Plaintext
193 lines
3.5 KiB
Plaintext
====
|
|
---- QUERY
|
|
# Inner equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
inner join functional.alltypestiny att on at.id = att.id
|
|
where att.int_col = 999
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Right equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
right join functional.alltypestiny att on at.id = att.id
|
|
where att.int_col = 999
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
left join (
|
|
select * from functional.alltypestiny where int_col = 999) att on at.id = att.id
|
|
order by at.id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Full outer equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
full outer join (
|
|
select * from functional.alltypestiny where int_col = 999) att on at.id = att.id
|
|
order by at.id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left semi equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
where id in (
|
|
select id from functional.alltypestiny
|
|
where id = 999)
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Right semi equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from (select * from functional.alltypestiny att where int_col = 999) att
|
|
right semi join alltypes at on at.id = att.id
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left NAAJ equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
where id not in (
|
|
select id from functional.alltypestiny
|
|
where id = 999)
|
|
order by id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left anti equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
where not exists (
|
|
select id from functional.alltypestiny att
|
|
where id = 999 and att.id = at.id)
|
|
order by id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Right anti equi-join - executes with hash join.
|
|
select straight_join at.id
|
|
from (select * from functional.alltypestiny att where int_col = 999) att
|
|
right anti join alltypes at on at.id = att.id
|
|
order by at.id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Inner non-equi-join - executes with nested loop join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
inner join functional.alltypestiny att on at.id < att.id
|
|
where att.int_col = 999
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Cross join - executes with nested loop join.
|
|
select straight_join at.id
|
|
from alltypes at, functional.alltypestiny att
|
|
where att.int_col = 999
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left non-equi-join - executes with nested loop join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
left join (
|
|
select * from functional.alltypestiny where int_col = 999) att on at.id < att.id
|
|
order by at.id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left semi non-equi-join - executes with nested loop join.
|
|
select straight_join at.id
|
|
from alltypes at
|
|
left semi join (
|
|
select * from functional.alltypestiny att where int_col = 999) att on at.id < att.id
|
|
order by at.id desc
|
|
limit 5
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left anti non-equi-join - executes with nested loop join.
|
|
select straight_join at.id
|
|
from alltypes at left anti join (
|
|
select * from functional.alltypestiny att
|
|
where id = 999) att on at.id < att.id
|
|
order by id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|