mirror of
https://github.com/apache/impala.git
synced 2026-01-02 03:00:32 -05:00
Change-Id: I2ed606ba398990ab05afa3301b6356c6a636e2bb Reviewed-on: http://gerrit.ent.cloudera.com:8080/2521 Reviewed-by: Matthew Jacobs <mj@cloudera.com> Tested-by: jenkins (cherry picked from commit 55061f6953956f45d433fe227ded539a648e3f9c) Reviewed-on: http://gerrit.ent.cloudera.com:8080/2536
60 lines
2.1 KiB
Plaintext
60 lines
2.1 KiB
Plaintext
====
|
|
---- QUERY
|
|
# Gets all types including a row with a NULL value. The predicate pushed to
|
|
# the data source is not actually used, but the second predicate is
|
|
# evaluated by Impala.
|
|
select *
|
|
from alltypes_datasource
|
|
where float_col != 0 and
|
|
int_col >= 1990 limit 5
|
|
---- RESULTS
|
|
1990,true,0,90,1990,19900,2189,1990,1970-01-01 00:00:01.990000000,'NULL'
|
|
1991,false,1,91,1991,19910,2190.10009765625,1991,1970-01-01 00:00:01.991000000,'1991'
|
|
1992,true,2,92,1992,19920,2191.199951171875,1992,1970-01-01 00:00:01.992000000,'1992'
|
|
1993,false,3,93,1993,19930,2192.300048828125,1993,1970-01-01 00:00:01.993000000,'1993'
|
|
1994,true,4,94,1994,19940,2193.39990234375,1994,1970-01-01 00:00:01.994000000,'1994'
|
|
---- TYPES
|
|
INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, TIMESTAMP, STRING
|
|
====
|
|
---- QUERY
|
|
# Project a subset of the columns
|
|
select bigint_col, timestamp_col, double_col
|
|
from alltypes_datasource
|
|
where double_col != 0 and int_col >= 1990 limit 3
|
|
---- RESULTS
|
|
19900,1970-01-01 00:00:01.990000000,1990
|
|
19910,1970-01-01 00:00:01.991000000,1991
|
|
19920,1970-01-01 00:00:01.992000000,1992
|
|
---- TYPES
|
|
BIGINT, TIMESTAMP, DOUBLE
|
|
====
|
|
---- QUERY
|
|
# count(*) with a predicate evaluated by Impala
|
|
select count(*) from alltypes_datasource
|
|
where float_col = 0 and
|
|
string_col is not NULL
|
|
---- RESULTS
|
|
4000
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
# count(*) with no predicates has no materialized slots
|
|
select count(*) from alltypes_datasource
|
|
---- RESULTS
|
|
5000
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
# Test decimal values. The test data source returns very large and very small values.
|
|
select * from decimal_datasource limit 5
|
|
---- RESULTS
|
|
-999999999,-9999999999,-9999999999.9999999999,-9.9999999999999999999999999999999999999,-99999.99999
|
|
999999998,9999999998,9999999999.9999999998,9.9999999999999999999999999999999999998,99999.99998
|
|
-999999997,-9999999997,-9999999999.9999999997,-9.9999999999999999999999999999999999997,-99999.99997
|
|
999999996,9999999996,9999999999.9999999996,9.9999999999999999999999999999999999996,99999.99996
|
|
-999999995,-9999999995,-9999999999.9999999995,-9.9999999999999999999999999999999999995,-99999.99995
|
|
---- TYPES
|
|
DECIMAL, DECIMAL, DECIMAL, DECIMAL, DECIMAL
|
|
==== |