mirror of
https://github.com/apache/impala.git
synced 2025-12-31 15:00:10 -05:00
Exprs need to be prepared and opened before calling GetValue(). Change-Id: I51d111b79c3453c9ab7acad14b93566f03decbcc Reviewed-on: http://gerrit.ent.cloudera.com:8080/2959 Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com> Tested-by: jenkins (cherry picked from commit fa602080d7fb1aad90ea5f9446d82ff953169974) Reviewed-on: http://gerrit.ent.cloudera.com:8080/2994
144 lines
2.8 KiB
Plaintext
144 lines
2.8 KiB
Plaintext
====
|
|
---- QUERY
|
|
# hdfs table sink
|
|
drop table if exists udfinserttest;
|
|
create table udfinserttest (udf_was_opened boolean);
|
|
|
|
insert overwrite table udfinserttest
|
|
select validate_open(int_col) from functional.alltypestiny limit 1;
|
|
====
|
|
---- QUERY
|
|
select * from udfinserttest;
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
true
|
|
====
|
|
---- QUERY
|
|
drop table if exists udfinserttest;
|
|
create table udfinserttest (a int) partitioned by (udf_was_opened string);
|
|
|
|
insert overwrite table udfinserttest
|
|
partition (udf_was_opened=cast(validate_open(1) as string)) values (1);
|
|
|
|
# IMPALA-1030: exercise the case where a partition already exists
|
|
insert overwrite table udfinserttest
|
|
partition (udf_was_opened=cast(validate_open(1) as string)) values (1);
|
|
|
|
# Don't overwrite
|
|
insert into table udfinserttest
|
|
partition (udf_was_opened=cast(validate_open(1) as string)) values (2);
|
|
====
|
|
---- QUERY
|
|
select * from udfinserttest;
|
|
---- TYPES
|
|
int, string
|
|
---- RESULTS
|
|
1,'1'
|
|
2,'1'
|
|
====
|
|
---- QUERY
|
|
# merge node
|
|
select validate_open(0);
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
true
|
|
====
|
|
---- QUERY
|
|
# merge node with conjuncts
|
|
select validate_open(0) from functional.alltypestiny where validate_open(0) limit 1;
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
true
|
|
====
|
|
---- QUERY
|
|
# hdfs scan node
|
|
select count(*) from functional.alltypestiny where validate_open(int_col);
|
|
---- TYPES
|
|
bigint
|
|
---- RESULTS
|
|
8
|
|
====
|
|
---- QUERY
|
|
# aggregation
|
|
select validate_open(int_col), count(*) from functional.alltypestiny
|
|
group by validate_open(int_col)
|
|
---- TYPES
|
|
boolean, bigint
|
|
---- RESULTS
|
|
true,8
|
|
====
|
|
---- QUERY
|
|
# aggregation
|
|
select count(if(validate_open(int_col), null, 1)) from functional.alltypestiny
|
|
---- TYPES
|
|
bigint
|
|
---- RESULTS
|
|
0
|
|
====
|
|
---- QUERY
|
|
# aggregation (conjuncts)
|
|
select int_col, count(*) from functional.alltypestiny
|
|
group by int_col having validate_open(int_col)
|
|
---- TYPES
|
|
int, bigint
|
|
---- RESULTS
|
|
0,4
|
|
1,4
|
|
====
|
|
---- QUERY
|
|
# hash join
|
|
select b.bool_col from functional.alltypestiny a join functional.alltypestiny b
|
|
on validate_open(a.int_col) = b.bool_col
|
|
where a.month = 3 and b.month = 3
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
true
|
|
true
|
|
====
|
|
---- QUERY
|
|
# hash join (other join predicate)
|
|
select count(*) from functional.alltypestiny a left outer join functional.alltypessmall b
|
|
on (a.bigint_col = b.bigint_col and validate_open(a.int_col))
|
|
---- TYPES
|
|
bigint
|
|
---- RESULTS
|
|
96
|
|
====
|
|
---- QUERY
|
|
# hash join (other predicate)
|
|
select count(*) from functional.alltypestiny a left outer join functional.alltypessmall b
|
|
on (a.bigint_col = b.bigint_col)
|
|
where validate_open(a.int_col) = validate_open(b.int_col)
|
|
and validate_open(a.int_col)
|
|
---- TYPES
|
|
bigint
|
|
---- RESULTS
|
|
96
|
|
====
|
|
---- QUERY
|
|
# coordinator
|
|
select validate_open(int_col) from functional.alltypestiny;
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
true
|
|
true
|
|
true
|
|
true
|
|
true
|
|
true
|
|
true
|
|
true
|
|
====
|
|
---- QUERY
|
|
# FE
|
|
select bool_col from functional.alltypestiny limit if(validate_open(1), 0, 1)
|
|
---- TYPES
|
|
boolean
|
|
---- RESULTS
|
|
====
|