mirror of
https://github.com/apache/impala.git
synced 2026-02-03 00:00:40 -05:00
This is a mixed bag of simplifications, debugging improvements and test fixes that came up in the projection work. I had to update some planner tests because some expressions now include their arguments. Various things in the planner tests were stale, so there are spurious changes in the expected output that are ignored by the plan verification. Change-Id: I75d2c8cab79988300c1a9c6c23d6ccea53da7d23 Reviewed-on: http://gerrit.cloudera.org:8080/14265 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
559 lines
21 KiB
Plaintext
559 lines
21 KiB
Plaintext
# HAVING predicate assignment. No group by.
|
|
select count(distinct tinyint_col), count(distinct smallint_col), max(string_col)
|
|
from functional.alltypes
|
|
having count(distinct tinyint_col) < 10
|
|
and count(distinct smallint_col) between 20 and 30
|
|
and max(string_col) = 'test'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < 10, aggif(valid_tid(2,4,5) = 4, count(smallint_col)) <= 30, aggif(valid_tid(2,4,5) = 4, count(smallint_col)) >= 20, aggif(valid_tid(2,4,5) = 5, max(string_col)) = 'test'
|
|
| row-size=28B cardinality=0
|
|
|
|
|
02:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
01:AGGREGATE
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
row-size=16B cardinality=7.30K
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < 10, aggif(valid_tid(2,4,5) = 4, count(smallint_col)) <= 30, aggif(valid_tid(2,4,5) = 4, count(smallint_col)) >= 20, aggif(valid_tid(2,4,5) = 5, max(string_col)) = 'test'
|
|
| row-size=28B cardinality=0
|
|
|
|
|
07:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count:merge(tinyint_col)
|
|
| Class 1
|
|
| output: count:merge(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
06:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
02:AGGREGATE
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
05:AGGREGATE
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
04:EXCHANGE [HASH(CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(tinyint_col) WHEN 3 THEN murmur_hash(smallint_col) WHEN 5 THEN 0 END)]
|
|
|
|
|
01:AGGREGATE [STREAMING]
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
row-size=16B cardinality=7.30K
|
|
====
|
|
# HAVING predicate references multiple aggregates. No group by.
|
|
select count(distinct tinyint_col), count(distinct smallint_col), max(string_col)
|
|
from functional.alltypes
|
|
having count(distinct tinyint_col) < count(distinct smallint_col)
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < aggif(valid_tid(2,4,5) = 4, count(smallint_col))
|
|
| row-size=28B cardinality=0
|
|
|
|
|
02:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
01:AGGREGATE
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
row-size=16B cardinality=7.30K
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < aggif(valid_tid(2,4,5) = 4, count(smallint_col))
|
|
| row-size=28B cardinality=0
|
|
|
|
|
07:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count:merge(tinyint_col)
|
|
| Class 1
|
|
| output: count:merge(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
06:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
02:AGGREGATE
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
05:AGGREGATE
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
04:EXCHANGE [HASH(CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(tinyint_col) WHEN 3 THEN murmur_hash(smallint_col) WHEN 5 THEN 0 END)]
|
|
|
|
|
01:AGGREGATE [STREAMING]
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
row-size=16B cardinality=7.30K
|
|
====
|
|
# Predicates assigned through inline view. No group by.
|
|
select a, b, c from
|
|
(select count(distinct tinyint_col) a, count(distinct smallint_col) b, max(string_col) c
|
|
from functional.alltypes) v
|
|
where a < b and b between 20 and 30 and c = 'test'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)) <= 30, aggif(valid_tid(2,4,5) = 4, count(smallint_col)) >= 20, aggif(valid_tid(2,4,5) = 5, max(string_col)) = 'test'
|
|
| row-size=28B cardinality=0
|
|
|
|
|
02:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
01:AGGREGATE
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
row-size=16B cardinality=7.30K
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)) <= 30, aggif(valid_tid(2,4,5) = 4, count(smallint_col)) >= 20, aggif(valid_tid(2,4,5) = 5, max(string_col)) = 'test'
|
|
| row-size=28B cardinality=0
|
|
|
|
|
07:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count:merge(tinyint_col)
|
|
| Class 1
|
|
| output: count:merge(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
06:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
02:AGGREGATE
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
05:AGGREGATE
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
04:EXCHANGE [HASH(CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(tinyint_col) WHEN 3 THEN murmur_hash(smallint_col) WHEN 5 THEN 0 END)]
|
|
|
|
|
01:AGGREGATE [STREAMING]
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
row-size=16B cardinality=7.30K
|
|
====
|
|
# Predicates assigned through inline view. No group by.
|
|
select a, b, c from
|
|
(select count(distinct tinyint_col) a, count(distinct smallint_col) b, max(string_col) c
|
|
from functional.alltypes) v
|
|
where a < b and b between 20 and 30 and c = 'test'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)) <= 30, aggif(valid_tid(2,4,5) = 4, count(smallint_col)) >= 20, aggif(valid_tid(2,4,5) = 5, max(string_col)) = 'test'
|
|
| row-size=28B cardinality=0
|
|
|
|
|
02:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
01:AGGREGATE
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
row-size=16B cardinality=7.30K
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)) <= 30, aggif(valid_tid(2,4,5) = 4, count(smallint_col)) >= 20, aggif(valid_tid(2,4,5) = 5, max(string_col)) = 'test'
|
|
| row-size=28B cardinality=0
|
|
|
|
|
07:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count:merge(tinyint_col)
|
|
| Class 1
|
|
| output: count:merge(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
06:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
02:AGGREGATE
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=28B cardinality=3
|
|
|
|
|
05:AGGREGATE
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
04:EXCHANGE [HASH(CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(tinyint_col) WHEN 3 THEN murmur_hash(smallint_col) WHEN 5 THEN 0 END)]
|
|
|
|
|
01:AGGREGATE [STREAMING]
|
|
| Class 0
|
|
| group by: tinyint_col
|
|
| Class 1
|
|
| group by: smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| row-size=15B cardinality=21
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
row-size=16B cardinality=7.30K
|
|
====
|
|
# HAVING predicate assignment. With group by.
|
|
select count(distinct tinyint_col), count(distinct smallint_col), max(string_col)
|
|
from functional.alltypes
|
|
group by date_string_col, timestamp_col
|
|
having count(distinct tinyint_col) < 10
|
|
and date_string_col between 'test1' and 'test2'
|
|
and cast(timestamp_col as string) < date_string_col
|
|
and cast(timestamp_col as bigint) = count(distinct tinyint_col)
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| group by: CASE valid_tid(2,4,5) WHEN 2 THEN date_string_col WHEN 4 THEN date_string_col WHEN 5 THEN date_string_col END, CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < 10, CAST(CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END AS BIGINT) = aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), CAST(CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END AS STRING) < CASE valid_tid(2,4,5) WHEN 2 THEN date_string_col WHEN 4 THEN date_string_col WHEN 5 THEN date_string_col END
|
|
| row-size=56B cardinality=657
|
|
|
|
|
02:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=136B cardinality=6.57K
|
|
|
|
|
01:AGGREGATE
|
|
| Class 0
|
|
| group by: date_string_col, timestamp_col, tinyint_col
|
|
| Class 1
|
|
| group by: date_string_col, timestamp_col, smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=123B cardinality=2.19K
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
predicates: functional.alltypes.date_string_col <= 'test2', functional.alltypes.date_string_col >= 'test1', CAST(functional.alltypes.timestamp_col AS STRING) < functional.alltypes.date_string_col
|
|
row-size=52B cardinality=730
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
08:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| group by: CASE valid_tid(2,4,5) WHEN 2 THEN date_string_col WHEN 4 THEN date_string_col WHEN 5 THEN date_string_col END, CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < 10, CAST(CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END AS BIGINT) = aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), CAST(CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END AS STRING) < CASE valid_tid(2,4,5) WHEN 2 THEN date_string_col WHEN 4 THEN date_string_col WHEN 5 THEN date_string_col END
|
|
| row-size=56B cardinality=657
|
|
|
|
|
07:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count:merge(tinyint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 1
|
|
| output: count:merge(smallint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=136B cardinality=6.57K
|
|
|
|
|
06:EXCHANGE [HASH(CASE valid_tid(2,4,5) WHEN 2 THEN murmur_hash(date_string_col) WHEN 4 THEN murmur_hash(date_string_col) WHEN 5 THEN murmur_hash(date_string_col) END,CASE valid_tid(2,4,5) WHEN 2 THEN murmur_hash(timestamp_col) WHEN 4 THEN murmur_hash(timestamp_col) WHEN 5 THEN murmur_hash(timestamp_col) END)]
|
|
|
|
|
02:AGGREGATE [STREAMING]
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=136B cardinality=6.57K
|
|
|
|
|
05:AGGREGATE
|
|
| Class 0
|
|
| group by: date_string_col, timestamp_col, tinyint_col
|
|
| Class 1
|
|
| group by: date_string_col, timestamp_col, smallint_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=123B cardinality=2.19K
|
|
|
|
|
04:EXCHANGE [HASH(CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(date_string_col) WHEN 3 THEN murmur_hash(date_string_col) WHEN 5 THEN murmur_hash(date_string_col) END,CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(timestamp_col) WHEN 3 THEN murmur_hash(timestamp_col) WHEN 5 THEN murmur_hash(timestamp_col) END,CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(tinyint_col) WHEN 3 THEN murmur_hash(smallint_col) WHEN 5 THEN 0 END)]
|
|
|
|
|
01:AGGREGATE [STREAMING]
|
|
| Class 0
|
|
| group by: date_string_col, timestamp_col, tinyint_col
|
|
| Class 1
|
|
| group by: date_string_col, timestamp_col, smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=123B cardinality=2.19K
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
predicates: functional.alltypes.date_string_col <= 'test2', functional.alltypes.date_string_col >= 'test1', CAST(functional.alltypes.timestamp_col AS STRING) < functional.alltypes.date_string_col
|
|
row-size=52B cardinality=730
|
|
====
|
|
# Predicate assignment through an inline view. With group by.
|
|
select a, b, c from
|
|
(select count(distinct tinyint_col) a, count(distinct smallint_col) b, max(string_col) c,
|
|
date_string_col gby1, timestamp_col gby2
|
|
from functional.alltypes
|
|
group by gby1, gby2) v
|
|
where a < 10 and gby1 between 'test1' and 'test2' and cast(gby2 as string) < gby1
|
|
and cast(gby2 as bigint) = a
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| group by: CASE valid_tid(2,4,5) WHEN 2 THEN date_string_col WHEN 4 THEN date_string_col WHEN 5 THEN date_string_col END, CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < 10, CAST(CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END AS BIGINT) = aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), CAST(CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END AS STRING) < CASE valid_tid(2,4,5) WHEN 2 THEN date_string_col WHEN 4 THEN date_string_col WHEN 5 THEN date_string_col END
|
|
| row-size=56B cardinality=657
|
|
|
|
|
02:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=136B cardinality=6.57K
|
|
|
|
|
01:AGGREGATE
|
|
| Class 0
|
|
| group by: date_string_col, timestamp_col, tinyint_col
|
|
| Class 1
|
|
| group by: date_string_col, timestamp_col, smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=123B cardinality=2.19K
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
predicates: functional.alltypes.date_string_col <= 'test2', functional.alltypes.date_string_col >= 'test1', CAST(functional.alltypes.timestamp_col AS STRING) < functional.alltypes.date_string_col
|
|
row-size=52B cardinality=730
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
08:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), aggif(valid_tid(2,4,5) = 4, count(smallint_col)), aggif(valid_tid(2,4,5) = 5, max(string_col))
|
|
| group by: CASE valid_tid(2,4,5) WHEN 2 THEN date_string_col WHEN 4 THEN date_string_col WHEN 5 THEN date_string_col END, CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END
|
|
| having: aggif(valid_tid(2,4,5) = 2, count(tinyint_col)) < 10, CAST(CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END AS BIGINT) = aggif(valid_tid(2,4,5) = 2, count(tinyint_col)), CAST(CASE valid_tid(2,4,5) WHEN 2 THEN timestamp_col WHEN 4 THEN timestamp_col WHEN 5 THEN timestamp_col END AS STRING) < CASE valid_tid(2,4,5) WHEN 2 THEN date_string_col WHEN 4 THEN date_string_col WHEN 5 THEN date_string_col END
|
|
| row-size=56B cardinality=657
|
|
|
|
|
07:AGGREGATE [FINALIZE]
|
|
| Class 0
|
|
| output: count:merge(tinyint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 1
|
|
| output: count:merge(smallint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=136B cardinality=6.57K
|
|
|
|
|
06:EXCHANGE [HASH(CASE valid_tid(2,4,5) WHEN 2 THEN murmur_hash(date_string_col) WHEN 4 THEN murmur_hash(date_string_col) WHEN 5 THEN murmur_hash(date_string_col) END,CASE valid_tid(2,4,5) WHEN 2 THEN murmur_hash(timestamp_col) WHEN 4 THEN murmur_hash(timestamp_col) WHEN 5 THEN murmur_hash(timestamp_col) END)]
|
|
|
|
|
02:AGGREGATE [STREAMING]
|
|
| Class 0
|
|
| output: count(tinyint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 1
|
|
| output: count(smallint_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=136B cardinality=6.57K
|
|
|
|
|
05:AGGREGATE
|
|
| Class 0
|
|
| group by: date_string_col, timestamp_col, tinyint_col
|
|
| Class 1
|
|
| group by: date_string_col, timestamp_col, smallint_col
|
|
| Class 2
|
|
| output: max:merge(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=123B cardinality=2.19K
|
|
|
|
|
04:EXCHANGE [HASH(CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(date_string_col) WHEN 3 THEN murmur_hash(date_string_col) WHEN 5 THEN murmur_hash(date_string_col) END,CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(timestamp_col) WHEN 3 THEN murmur_hash(timestamp_col) WHEN 5 THEN murmur_hash(timestamp_col) END,CASE valid_tid(1,3,5) WHEN 1 THEN murmur_hash(tinyint_col) WHEN 3 THEN murmur_hash(smallint_col) WHEN 5 THEN 0 END)]
|
|
|
|
|
01:AGGREGATE [STREAMING]
|
|
| Class 0
|
|
| group by: date_string_col, timestamp_col, tinyint_col
|
|
| Class 1
|
|
| group by: date_string_col, timestamp_col, smallint_col
|
|
| Class 2
|
|
| output: max(string_col)
|
|
| group by: date_string_col, timestamp_col
|
|
| row-size=123B cardinality=2.19K
|
|
|
|
|
00:SCAN HDFS [functional.alltypes]
|
|
HDFS partitions=24/24 files=24 size=478.45KB
|
|
predicates: functional.alltypes.date_string_col <= 'test2', functional.alltypes.date_string_col >= 'test1', CAST(functional.alltypes.timestamp_col AS STRING) < functional.alltypes.date_string_col
|
|
row-size=52B cardinality=730
|
|
====
|