mirror of
https://github.com/apache/impala.git
synced 2026-01-06 06:01:03 -05:00
Reworks the FK/PK join detection logic to: - more accurately recognize many-to-many joins - avoid dim/dim joins for multi-column PKs The new detection logic maintains our existing philosophy of generally assuming a FK/PK join, unless there is strong evidence to the contrary, as follows. For each set of simple equi-join conjuncts between two tables, we compute the joint NDV of the right-hand side columns by multiplication, and if the joint NDV is significantly smaller than the right-hand side row count, then we are fairly confident that the right-hand side is not a PK. Otherwise, we assume the set of conjuncts could represent a FK/PK relationship. Extends the explain plan to include the outcome of the FK/PK detection at EXPLAIN_LEVEL > STANDARD. Performance testing: 1. Full TPC-DS run on 10TB: - Q10 improved by >100x - Q72 improved by >25x - Q17,Q26,Q29 improved by 2x - Q64 regressed by 10x - Total runtime: Improved by 2x - Geomean: Minor improvement The regression of Q64 is understood and we will try to address it in follow-on changes. The previous plan was better by accident and not because of superior logic. 2. Nightly TPC-H and TPC-DS runs: - No perf differences Testing: - The existing planner test cover the changes. - Code/hdfs run passed. Change-Id: I49074fe743a28573cff541ef7dbd0edd88892067 Reviewed-on: http://gerrit.cloudera.org:8080/7257 Reviewed-by: Alex Behm <alex.behm@cloudera.com> Tested-by: Impala Public Jenkins
627 lines
15 KiB
Plaintext
627 lines
15 KiB
Plaintext
# full scan of string typed row-key
|
|
select * from functional_hbase.stringids
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
====
|
|
# predicate on row key doesn't get transformed into scan parameter, because
|
|
# it's mapped as an int (but stored in ascii and ordered lexicographically)
|
|
select * from functional_hbase.alltypessmall
|
|
where id < 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
predicates: id < 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16201 <unbounded>:3
|
|
HBASE KEYRANGE port=16202 3:7
|
|
HBASE KEYRANGE port=16203 7:<unbounded>
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
predicates: id < 5
|
|
====
|
|
# if the row key is mapped as a string col, range predicates are applied to the scan
|
|
select * from functional_hbase.stringids
|
|
where id = '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 5
|
|
stop key: 5\0
|
|
predicates: tinyint_col = 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 5:5\0
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 5
|
|
stop key: 5\0
|
|
predicates: tinyint_col = 5
|
|
====
|
|
select * from functional_hbase.stringids
|
|
where id > '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 5\0
|
|
predicates: tinyint_col = 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 5\0:7
|
|
HBASE KEYRANGE port=16203 7:<unbounded>
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 5\0
|
|
predicates: tinyint_col = 5
|
|
====
|
|
select * from functional_hbase.stringids
|
|
where id >= '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 5
|
|
predicates: tinyint_col = 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 5:7
|
|
HBASE KEYRANGE port=16203 7:<unbounded>
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 5
|
|
predicates: tinyint_col = 5
|
|
====
|
|
select * from functional_hbase.stringids
|
|
where id < '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
stop key: 5
|
|
predicates: tinyint_col = 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16201 <unbounded>:3
|
|
HBASE KEYRANGE port=16202 3:5
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
stop key: 5
|
|
predicates: tinyint_col = 5
|
|
====
|
|
select * from functional_hbase.stringids
|
|
where id <= '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
stop key: 5\0
|
|
predicates: tinyint_col = 5
|
|
====
|
|
select * from functional_hbase.stringids
|
|
where id > '4' and id < '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4\0
|
|
stop key: 5
|
|
predicates: tinyint_col = 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 4\0:5
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4\0
|
|
stop key: 5
|
|
predicates: tinyint_col = 5
|
|
====
|
|
select * from functional_hbase.stringids
|
|
where id >= '4' and id < '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4
|
|
stop key: 5
|
|
predicates: tinyint_col = 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 4:5
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4
|
|
stop key: 5
|
|
predicates: tinyint_col = 5
|
|
====
|
|
select * from functional_hbase.stringids
|
|
where id > '4' and id <= '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4\0
|
|
stop key: 5\0
|
|
predicates: tinyint_col = 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 4\0:5\0
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4\0
|
|
stop key: 5\0
|
|
predicates: tinyint_col = 5
|
|
====
|
|
select * from functional_hbase.stringids
|
|
where id >= '4' and id <= '5'
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4
|
|
stop key: 5\0
|
|
predicates: tinyint_col = 5
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 4:5\0
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4
|
|
stop key: 5\0
|
|
predicates: tinyint_col = 5
|
|
====
|
|
# with aggregation
|
|
select int_col, count(*)
|
|
from functional_hbase.alltypessmall
|
|
where id < 5
|
|
group by 1
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:AGGREGATE [FINALIZE]
|
|
| output: count(*)
|
|
| group by: int_col
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
predicates: id < 5
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
04:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: count:merge(*)
|
|
| group by: int_col
|
|
|
|
|
02:EXCHANGE [HASH(int_col)]
|
|
|
|
|
01:AGGREGATE [STREAMING]
|
|
| output: count(*)
|
|
| group by: int_col
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
predicates: id < 5
|
|
====
|
|
# predicates on string columns against a constant string are converted to HBase filters
|
|
select * from functional_hbase.alltypessmall where string_col = '4'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col EQUAL '4'
|
|
predicates: string_col = '4'
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col EQUAL '4'
|
|
predicates: string_col = '4'
|
|
====
|
|
# test all comparison ops
|
|
select * from functional_hbase.alltypessmall where string_col != '4'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col NOT_EQUAL '4'
|
|
predicates: string_col != '4'
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col NOT_EQUAL '4'
|
|
predicates: string_col != '4'
|
|
====
|
|
select * from functional_hbase.alltypessmall where string_col < '4'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col LESS '4'
|
|
predicates: string_col < '4'
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col LESS '4'
|
|
predicates: string_col < '4'
|
|
====
|
|
select * from functional_hbase.alltypessmall where string_col > '4'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col GREATER '4'
|
|
predicates: string_col > '4'
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col GREATER '4'
|
|
predicates: string_col > '4'
|
|
====
|
|
select * from functional_hbase.alltypessmall where string_col <= '4'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col LESS_OR_EQUAL '4'
|
|
predicates: string_col <= '4'
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col LESS_OR_EQUAL '4'
|
|
predicates: string_col <= '4'
|
|
====
|
|
select * from functional_hbase.alltypessmall where string_col >= '4'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col GREATER_OR_EQUAL '4'
|
|
predicates: string_col >= '4'
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col GREATER_OR_EQUAL '4'
|
|
predicates: string_col >= '4'
|
|
====
|
|
# test multiple filters
|
|
select * from functional_hbase.alltypessmall
|
|
where string_col >= '4' and string_col != '2' and date_string_col = '04/03/09'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters:
|
|
d:string_col NOT_EQUAL '2'
|
|
d:string_col GREATER_OR_EQUAL '4'
|
|
d:date_string_col EQUAL '04/03/09'
|
|
predicates: string_col != '2', string_col >= '4', date_string_col = '04/03/09'
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters:
|
|
d:string_col NOT_EQUAL '2'
|
|
d:string_col GREATER_OR_EQUAL '4'
|
|
d:date_string_col EQUAL '04/03/09'
|
|
predicates: string_col != '2', string_col >= '4', date_string_col = '04/03/09'
|
|
====
|
|
# mix of predicates and functional_hbase. filters
|
|
select * from functional_hbase.alltypessmall where string_col = '4' and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
hbase filters: d:string_col EQUAL '4'
|
|
predicates: tinyint_col = 5, string_col = '4'
|
|
====
|
|
# mix of predicates, functional_hbase. filters and start/stop keys
|
|
select * from functional_hbase.stringids
|
|
where string_col = '4' and tinyint_col = 5 and id >= '4' and id <= '5'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4
|
|
stop key: 5\0
|
|
hbase filters: d:string_col EQUAL '4'
|
|
predicates: tinyint_col = 5, string_col = '4'
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 4:5\0
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4
|
|
stop key: 5\0
|
|
hbase filters: d:string_col EQUAL '4'
|
|
predicates: tinyint_col = 5, string_col = '4'
|
|
====
|
|
# predicates involving casts (ie, non-string comparisons) cannot be turned into filters
|
|
select * from functional_hbase.alltypessmall where cast(string_col as int) >= 4
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
predicates: CAST(string_col AS INT) >= 4
|
|
====
|
|
# non-const comparisons cannot be turned into filters
|
|
select * from functional_hbase.alltypessmall where string_col >= date_string_col
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypessmall]
|
|
predicates: string_col >= date_string_col
|
|
====
|
|
# IMP-1188 - row key predicate is a constant expr.
|
|
select * from functional_hbase.stringids
|
|
where id = concat('', '5')
|
|
and tinyint_col = 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 5
|
|
stop key: 5\0
|
|
predicates: tinyint_col = 5
|
|
====
|
|
# IMP-1188 - row key predicate is a constant expr.
|
|
select * from functional_hbase.stringids
|
|
where string_col = '4' and tinyint_col = 5
|
|
and id >= concat('', '4') and id <= concat('5', '')
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4
|
|
stop key: 5\0
|
|
hbase filters: d:string_col EQUAL '4'
|
|
predicates: tinyint_col = 5, string_col = '4'
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16202 4:5\0
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
start key: 4
|
|
stop key: 5\0
|
|
hbase filters: d:string_col EQUAL '4'
|
|
predicates: tinyint_col = 5, string_col = '4'
|
|
====
|
|
# IMP-1188 - row key predicate is null.
|
|
select * from functional_hbase.stringids where id = null
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
empty scan node
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
empty scan node
|
|
====
|
|
# IMP-1188 - row key lower bound is bigger than upper bound.
|
|
select * from functional_hbase.stringids where id > 'b' and id < 'a'
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
empty scan node
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
empty scan node
|
|
====
|
|
# IMP-1188 - casting row key to non-string type disables predicate from being pushed
|
|
# into HBase
|
|
select * from functional_hbase.stringids
|
|
where cast(id as int) < 5
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.stringids]
|
|
predicates: CAST(id AS INT) < 5
|
|
====
|
|
# The following test cases test plan generation for queries executed against HBase
|
|
# and have 'IS NULL/IS NOT NULL' predicates as well as conjunctive predicates.
|
|
# (IMPALA-642)
|
|
#
|
|
# HBase scan query with an 'IS NULL' predicate
|
|
select * from functional_hbase.alltypesagg
|
|
where bigint_col is null
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col IS NULL
|
|
====
|
|
# HBase scan query with projection and an 'IS NULL' predicate on one of the
|
|
# projected columns
|
|
select bigint_col, day from functional_hbase.alltypesagg
|
|
where bigint_col is null
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col IS NULL
|
|
====
|
|
# HBase scan query with 'IS NOT NULL' predicate
|
|
select * from functional_hbase.alltypesagg
|
|
where bigint_col is not null
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col IS NOT NULL
|
|
====
|
|
# HBase scan query with conjunctive predicates one of which is an 'IS NULL'
|
|
select * from functional_hbase.alltypesagg
|
|
where bigint_col is null and day = 1
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col IS NULL, day = 1
|
|
====
|
|
# HBase scan query with conjunctive predicates one of which is an 'IS NOT NULL'
|
|
select * from functional_hbase.alltypesagg
|
|
where bigint_col is not null and bool_col = true
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col IS NOT NULL, bool_col = TRUE
|
|
---- SCANRANGELOCATIONS
|
|
NODE 0:
|
|
HBASE KEYRANGE port=16201 <unbounded>:3
|
|
HBASE KEYRANGE port=16202 3:7
|
|
HBASE KEYRANGE port=16203 7:<unbounded>
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col IS NOT NULL, bool_col = TRUE
|
|
====
|
|
# HBase scan query with an aggregation and a single predicate
|
|
select count(*) from functional_hbase.alltypesagg
|
|
where bigint_col = 10
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:AGGREGATE [FINALIZE]
|
|
| output: count(*)
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col = 10
|
|
---- DISTRIBUTEDPLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
03:AGGREGATE [FINALIZE]
|
|
| output: count:merge(*)
|
|
|
|
|
02:EXCHANGE [UNPARTITIONED]
|
|
|
|
|
01:AGGREGATE
|
|
| output: count(*)
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col = 10
|
|
====
|
|
# HBase scan query with an aggregation and conjunctive predicates
|
|
select count(*) from functional_hbase.alltypesagg
|
|
where bigint_col = 10 and day = 1
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
01:AGGREGATE [FINALIZE]
|
|
| output: count(*)
|
|
|
|
|
00:SCAN HBASE [functional_hbase.alltypesagg]
|
|
predicates: bigint_col = 10, day = 1
|
|
====
|
|
# IMPALA-1141: Simple joins to make sure cardinality estimates are right.
|
|
select a.id, b.id, c.id
|
|
from
|
|
functional_hbase.alltypessmall b,
|
|
functional_hbase.alltypessmall a,
|
|
functional_hbase.alltypessmall c
|
|
where
|
|
b.bool_col = false and
|
|
c.month = 4 and
|
|
a.int_col = b.int_col and
|
|
c.int_col = b.int_col
|
|
---- PLAN
|
|
PLAN-ROOT SINK
|
|
|
|
|
04:HASH JOIN [INNER JOIN]
|
|
| hash predicates: a.int_col = b.int_col
|
|
|
|
|
|--00:SCAN HBASE [functional_hbase.alltypessmall b]
|
|
| predicates: b.bool_col = FALSE
|
|
|
|
|
03:HASH JOIN [INNER JOIN]
|
|
| hash predicates: a.int_col = c.int_col
|
|
|
|
|
|--02:SCAN HBASE [functional_hbase.alltypessmall c]
|
|
| predicates: c.month = 4
|
|
|
|
|
01:SCAN HBASE [functional_hbase.alltypessmall a]
|
|
====
|