mirror of
https://github.com/apache/impala.git
synced 2026-01-01 09:00:42 -05:00
Change-Id: I3b151ace464c67634104f84f7223c948fed8909e Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5406 Reviewed-by: Alex Behm <alex.behm@cloudera.com> Tested-by: jenkins (cherry picked from commit c2959485a066b5c0b40e8b0790d526726236d0c9) Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5409 Reviewed-by: Nong Li <nong@cloudera.com> Tested-by: Nong Li <nong@cloudera.com>
120 lines
2.4 KiB
Plaintext
120 lines
2.4 KiB
Plaintext
====
|
|
---- QUERY
|
|
# testtbl is empty
|
|
select * from testtbl
|
|
---- TYPES
|
|
bigint, string, int
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# month ends at 12
|
|
select int_col from alltypessmall where month > 100
|
|
---- TYPES
|
|
int
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# Empty partitioned table test
|
|
select field from emptytable
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# Constant conjunct.
|
|
select t1.id, t2.id
|
|
from functional.alltypestiny t1
|
|
left outer join functional.alltypes t2
|
|
on t1.id = t2.id
|
|
where false
|
|
---- TYPES
|
|
int, int
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# Constant conjunct in query block with an aggregation.
|
|
select count(int_col), avg(double_col), count(*)
|
|
from functional.alltypes
|
|
where null
|
|
---- TYPES
|
|
bigint, double, bigint
|
|
---- RESULTS
|
|
0,NULL,0
|
|
====
|
|
---- QUERY
|
|
# Constant conjunct in inline view.
|
|
select e.id, f.id
|
|
from functional.alltypessmall f
|
|
inner join
|
|
(select t1.id
|
|
from functional.alltypestiny t1
|
|
left outer join functional.alltypes t2
|
|
on t1.id = t2.id
|
|
where 1 + 3 > 10) e
|
|
on e.id = f.id
|
|
---- TYPES
|
|
int, int
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# Limit 0
|
|
select t1.id, t2.id
|
|
from functional.alltypestiny t1
|
|
left outer join functional.alltypes t2
|
|
on t1.id = t2.id
|
|
limit 0
|
|
---- TYPES
|
|
int, int
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# Limit 0 in query block with an aggregation
|
|
select count(int_col), avg(double_col), count(*)
|
|
from functional.alltypes
|
|
limit 0
|
|
---- TYPES
|
|
bigint, double, bigint
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# Limit 0 in inline view
|
|
select e.id, f.id
|
|
from functional.alltypessmall f
|
|
inner join
|
|
(select t1.id
|
|
from functional.alltypestiny t1
|
|
left outer join functional.alltypes t2
|
|
on t1.id = t2.id
|
|
limit 0) e
|
|
on e.id = f.id
|
|
---- TYPES
|
|
int, int
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# IMPALA-1234: Analytic with constant empty result set failed precondition check in FE
|
|
select MIN(int_col) OVER () FROM alltypes limit 0
|
|
---- RESULTS
|
|
---- TYPES
|
|
INT
|
|
====
|
|
---- QUERY
|
|
# IMPALA-1524: Materialize all tuples produced by an EmptySet node.
|
|
SELECT
|
|
COALESCE(580, MAX(t2.year), 150) AS int_col FROM (
|
|
SELECT
|
|
t1.bool_col,
|
|
COALESCE(LAG(-826, 69) OVER (
|
|
ORDER BY t1.bool_col DESC, COALESCE(t2.int_col, t2.smallint_col, t2.id)), 279, -764) AS int_col,
|
|
COALESCE(t2.int_col, t2.smallint_col, t2.id) AS int_col_2
|
|
FROM functional.alltypestiny t1
|
|
INNER JOIN functional.alltypestiny t2
|
|
ON ((t2.bigint_col) = (t1.id)) AND ((t2.timestamp_col) = (t1.timestamp_col))) t1
|
|
INNER JOIN functional.alltypes t2 ON (t2.year) = (t1.int_col_2)
|
|
WHERE (-339.22) IN (-922.68, -254.84)
|
|
---- RESULTS
|
|
580
|
|
---- TYPES
|
|
INT
|
|
====
|