You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "hexianqing (Jira)" <ji...@apache.org> on 2020/02/04 07:52:00 UTC
[jira] [Created] (IMPALA-9356) The predicate which the tuple ids
involved are empty can't migrate to outer-joined inline view
hexianqing created IMPALA-9356:
----------------------------------
Summary: The predicate which the tuple ids involved are empty can't migrate to outer-joined inline view
Key: IMPALA-9356
URL: https://issues.apache.org/jira/browse/IMPALA-9356
Project: IMPALA
Issue Type: Bug
Components: Frontend
Affects Versions: Impala 3.3.0
Reporter: hexianqing
{code}
SELECT COUNT(*)
FROM (
SELECT id, upper(string_col) AS upper_val
FROM functional.alltypestiny
) a
FULL JOIN (
SELECT id, upper(string_col) AS upper_val
FROM functional.alltypestiny
) b
ON a.id = b.id
WHERE rand() = 12
{code}
The Plan
{noformat}
+------------------------------------------------------------+
| Explain String |
+------------------------------------------------------------+
| Max Per-Host Resource Reservation: Memory=1.95MB Threads=6 |
| Per-Host Resource Estimates: Memory=86MB |
| Codegen disabled by planner |
| |
| PLAN-ROOT SINK |
| | |
| 07:AGGREGATE [FINALIZE] |
| | output: count:merge(*) |
| | row-size=8B cardinality=1 |
| | |
| 06:EXCHANGE [UNPARTITIONED] |
| | |
| 03:AGGREGATE |
| | output: count(*) |
| | row-size=8B cardinality=1 |
| | |
| 02:HASH JOIN [FULL OUTER JOIN, PARTITIONED] |
| | hash predicates: id = id |
| | row-size=8B cardinality=9 |
| | |
| |--05:EXCHANGE [HASH(id)] |
| | | |
| | 00:SCAN HDFS [functional.alltypestiny] |
| | HDFS partitions=4/4 files=4 size=460B |
| | predicates: rand() = 12 |
| | row-size=4B cardinality=1 |
| | |
| 04:EXCHANGE [HASH(id)] |
| | |
| 01:SCAN HDFS [functional.alltypestiny] |
| HDFS partitions=4/4 files=4 size=460B |
| row-size=4B cardinality=8 |
+------------------------------------------------------------+
{noformat}
The rand() returns a random value between 0 and 1 so "rand() = 12" will always be false. All rows should be rejected by the WHERE clause. If "rand() = 12" is evaluated in only one side, the other side can still produce rows. So the outer join will still have results.
We can't migrate the predicate that the tuple ids involved are empty to outer-joined inline view
--
This message was sent by Atlassian Jira
(v8.3.4#803005)