mirror of
https://github.com/apache/impala.git
synced 2026-01-02 12:00:33 -05:00
Previously, thread resource manager only supports a single callback for each resource pool. The callback is invoked when a thread token is available. This mostly works as scan node is the only consumer and there is usually one scan node in a plan fragment. As shown in IMPALA-3064 and IMPALA-561, it's possible to generate a plan fragment with more than one scan nodes. In which case, one of the scan nodes may be running with single thread and in debug builds, a DCHECK will be hit. This change fixes the problem by allowing more than one callbacks in a given resource pool. The thread resource manager will go through all the registered callbacks in round robin fashion. This change also adds a missing thread token release call in HdfsScanNode::ThreadTokenAvailableCb(). Change-Id: Iddfff1feef0b59d407994ad3bc560166acbfa623 Reviewed-on: http://gerrit.cloudera.org:8080/2430 Reviewed-by: Dan Hecht <dhecht@cloudera.com> Tested-by: Internal Jenkins
163 lines
3.5 KiB
Plaintext
163 lines
3.5 KiB
Plaintext
====
|
|
---- QUERY
|
|
# Right outer join with non-equi join predicates
|
|
select straight_join a.id, b.id, a.int_col, b.int_col
|
|
from alltypestiny a right outer join (values(1 as id, 1 as int_col)) b
|
|
on a.id != b.id or a.int_col < b.int_col
|
|
---- RESULTS
|
|
6,1,0,1
|
|
7,1,1,1
|
|
0,1,0,1
|
|
2,1,0,1
|
|
3,1,1,1
|
|
4,1,0,1
|
|
5,1,1,1
|
|
---- TYPES
|
|
INT, TINYINT, INT, TINYINT
|
|
====
|
|
---- QUERY
|
|
# Right semi join with non-equi join predicates
|
|
select straight_join *
|
|
from alltypesagg a right semi join (values((1 as id, 1 as int_col), (2,2))) b
|
|
on a.id != b.id
|
|
---- RESULTS
|
|
1,1
|
|
2,2
|
|
---- TYPES
|
|
TINYINT, TINYINT
|
|
====
|
|
---- QUERY
|
|
# Right anti join with non-equi join predicates
|
|
select straight_join *
|
|
from alltypestiny a right anti join (values((1 as id, 1 as int_col),(2,2),(3,3))) b
|
|
on a.id < b.id
|
|
---- RESULTS
|
|
---- TYPES
|
|
TINYINT, TINYINT
|
|
====
|
|
---- QUERY
|
|
# Full outer join with non-equi join predicates
|
|
select straight_join a.id, b.id
|
|
from alltypestiny a full outer join (values((1 as id), (100))) b
|
|
on a.id != b.id
|
|
---- RESULTS
|
|
6,1
|
|
6,100
|
|
7,1
|
|
7,100
|
|
4,1
|
|
4,100
|
|
5,1
|
|
5,100
|
|
2,1
|
|
2,100
|
|
3,1
|
|
3,100
|
|
0,1
|
|
0,100
|
|
1,100
|
|
---- TYPES
|
|
INT, TINYINT
|
|
====
|
|
---- QUERY
|
|
# Multi-way join query with right semi, right outer and full outer joins with
|
|
# non-equi join predicates
|
|
select straight_join *
|
|
from alltypestiny a right semi join (values(1 as tinyint_col, 1 as id)) c
|
|
on a.tinyint_col < c.tinyint_col
|
|
right outer join (values(1 as bigint_col)) d
|
|
on c.tinyint_col >= d.bigint_col
|
|
full outer join (values((1 as id, 1 as int_col),(2,2),(3,3))) e
|
|
on c.tinyint_col != e.id
|
|
---- RESULTS
|
|
1,1,1,2,2
|
|
1,1,1,3,3
|
|
NULL,NULL,NULL,1,1
|
|
---- TYPES
|
|
TINYINT, TINYINT, TINYINT, TINYINT, TINYINT
|
|
====
|
|
---- QUERY
|
|
# Right semi join where the probe input is significantly smaller than the build input.
|
|
select straight_join a.id, b.id
|
|
from (values(1 as tinyint_col, 1 as id)) a right outer join alltypessmall b
|
|
on a.tinyint_col != b.tinyint_col
|
|
order by a.id, b.id
|
|
limit 2
|
|
---- RESULTS
|
|
1,0
|
|
1,2
|
|
---- TYPES
|
|
TINYINT,INT
|
|
====
|
|
---- QUERY
|
|
# Right outer join where none of the build rows matches a probe row.
|
|
select straight_join count(*)
|
|
from (values(10000 as id)) a right outer join alltypesagg b
|
|
on a.id < b.id
|
|
where a.id is null
|
|
---- RESULTS
|
|
11000
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
# Full outer join where the probe input is smaller than the build input and
|
|
# it can fit in a single row batch.
|
|
select straight_join a.id, b.id
|
|
from (values(1 as id)) a full outer join alltypestiny b
|
|
on a.id < b.id
|
|
order by a.id, b.id
|
|
---- RESULTS
|
|
1,2
|
|
1,3
|
|
1,4
|
|
1,5
|
|
1,6
|
|
1,7
|
|
NULL,0
|
|
NULL,1
|
|
---- TYPES
|
|
TINYINT, INT
|
|
====
|
|
---- QUERY
|
|
# IMPALA-2319: the NLJ node returned more rows than limit in certain cases. This resulted
|
|
# in extra rows being returned to the client if the NLJ was the topmost node in the plan,
|
|
# which is the case when this query is executed on a single node. If this same query is
|
|
# executed on multiple nodes, the exchange enforces the limit and masks the bug.
|
|
select straight_join a, cnt from (values(1 a)) v1
|
|
cross join
|
|
(select id, count(*) cnt
|
|
from alltypes
|
|
group by id) v2 limit 5;
|
|
---- RESULTS
|
|
1,1
|
|
1,1
|
|
1,1
|
|
1,1
|
|
1,1
|
|
---- TYPES
|
|
TINYINT,BIGINT
|
|
====
|
|
---- QUERY
|
|
# IMPALA-2207: Aggregation feeding into build side of nested loop join.
|
|
# We want to test that this query doesn't crash or hit a DCHECK.
|
|
select straight_join * from (values(1 a)) v1
|
|
cross join
|
|
(select id, count(*) cnt
|
|
from alltypes
|
|
group by id) v2;
|
|
---- TYPES
|
|
TINYINT,INT,BIGINT
|
|
====
|
|
====
|
|
---- QUERY
|
|
# Regression test for IMPALA-561: Multiple scan nodes in a plan fragment.
|
|
select count(*)
|
|
from functional.alltypes a1
|
|
left join functional.alltypes a2 on a2.tinyint_col >= 1
|
|
---- RESULTS
|
|
47961000
|
|
---- TYPES
|
|
BIGINT
|
|
====
|