mirror of
https://github.com/apache/impala.git
synced 2026-01-06 06:01:03 -05:00
This patch reserves SQL:2016 reserved words, excluding: 1. Impala builtin function names. 2. Time unit words(year, month, etc.). 3. An exception list based on a discussion. Some test cases are modified to avoid these words. A impalad and catalogd startup option reserved_words_version is added. The words are reserved if the option is set to "3.0.0". Change-Id: If1b295e6a77e840cf1b794c2eb73e1b9d2b8ddd6 Reviewed-on: http://gerrit.cloudera.org:8080/9096 Reviewed-by: Alex Behm <alex.behm@cloudera.com> Reviewed-by: Philip Zeyliger <philip@cloudera.com> Tested-by: Impala Public Jenkins
193 lines
3.6 KiB
Plaintext
193 lines
3.6 KiB
Plaintext
====
|
|
---- QUERY
|
|
# Inner equi-join - executes with hash join.
|
|
select straight_join atp.id
|
|
from alltypes atp
|
|
inner join functional.alltypestiny att on atp.id = att.id
|
|
where att.int_col = 999
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Right equi-join - executes with hash join.
|
|
select straight_join atp.id
|
|
from alltypes atp
|
|
right join functional.alltypestiny att on atp.id = att.id
|
|
where att.int_col = 999
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left equi-join - executes with hash join.
|
|
select straight_join atp.id
|
|
from alltypes atp
|
|
left join (
|
|
select * from functional.alltypestiny where int_col = 999) att on atp.id = att.id
|
|
order by atp.id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Full outer equi-join - executes with hash join.
|
|
select straight_join atp.id
|
|
from alltypes atp
|
|
full outer join (
|
|
select * from functional.alltypestiny where int_col = 999) att on atp.id = att.id
|
|
order by atp.id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left semi equi-join - executes with hash join.
|
|
select straight_join atp.id
|
|
from alltypes atp
|
|
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 atp.id
|
|
from (select * from functional.alltypestiny att where int_col = 999) att
|
|
right semi join alltypes atp on atp.id = att.id
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left NAAJ equi-join - executes with hash join.
|
|
select straight_join atp.id
|
|
from alltypes atp
|
|
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 atp.id
|
|
from alltypes atp
|
|
where not exists (
|
|
select id from functional.alltypestiny att
|
|
where id = 999 and att.id = atp.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 atp.id
|
|
from (select * from functional.alltypestiny att where int_col = 999) att
|
|
right anti join alltypes atp on atp.id = att.id
|
|
order by atp.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 atp.id
|
|
from alltypes atp
|
|
inner join functional.alltypestiny att on atp.id < att.id
|
|
where att.int_col = 999
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Cross join - executes with nested loop join.
|
|
select straight_join atp.id
|
|
from alltypes atp, functional.alltypestiny att
|
|
where att.int_col = 999
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left non-equi-join - executes with nested loop join.
|
|
select straight_join atp.id
|
|
from alltypes atp
|
|
left join (
|
|
select * from functional.alltypestiny where int_col = 999) att on atp.id < att.id
|
|
order by atp.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 atp.id
|
|
from alltypes atp
|
|
left semi join (
|
|
select * from functional.alltypestiny att where int_col = 999) att on atp.id < att.id
|
|
order by atp.id desc
|
|
limit 5
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# Left anti non-equi-join - executes with nested loop join.
|
|
select straight_join atp.id
|
|
from alltypes atp left anti join (
|
|
select * from functional.alltypestiny att
|
|
where id = 999) att on atp.id < att.id
|
|
order by id desc
|
|
limit 5
|
|
---- RESULTS
|
|
7299
|
|
7298
|
|
7297
|
|
7296
|
|
7295
|
|
---- TYPES
|
|
INT
|
|
====
|