You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Tim Armstrong (Jira)" <ji...@apache.org> on 2020/08/13 22:27:00 UTC
[jira] [Commented] (IMPALA-3094) Incorrect result due to constant
evaluation in query with outer join
[ https://issues.apache.org/jira/browse/IMPALA-3094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17177345#comment-17177345 ]
Tim Armstrong commented on IMPALA-3094:
---------------------------------------
This seems to be a problem if you have a predicate in an ON clause that is constant false at query compile time, *and* there is an right/full outer/right semi/right anti join later in the from list. The planner incorrectly assumes that the result set will be empty.
> Incorrect result due to constant evaluation in query with outer join
> --------------------------------------------------------------------
>
> Key: IMPALA-3094
> URL: https://issues.apache.org/jira/browse/IMPALA-3094
> Project: IMPALA
> Issue Type: Bug
> Components: Frontend
> Affects Versions: Impala 2.5.0
> Reporter: casey
> Priority: Major
> Labels: correctness, downgraded
>
> Please see below
> {noformat}
> [localhost.localdomain:21000] > explain SELECT 1
> FROM alltypestiny a1
> INNER JOIN alltypesagg a2 ON a1.smallint_col = a2.year AND false
> RIGHT JOIN alltypes a3 ON a1.year = a1.bigint_col;
> Query: explain SELECT 1
> FROM alltypestiny a1
> INNER JOIN alltypesagg a2 ON a1.smallint_col = a2.year AND false
> RIGHT JOIN alltypes a3 ON a1.year = a1.bigint_col
> +---------------------------------------------------------+
> | Explain String |
> +---------------------------------------------------------+
> | Estimated Per-Host Requirements: Memory=1.00KB VCores=1 |
> | |
> | 00:EMPTYSET |
> +---------------------------------------------------------+
> Fetched 3 row(s) in 0.00s
> [localhost.localdomain:21000] > SELECT 1
> FROM alltypestiny a1
> INNER JOIN alltypesagg a2 ON a1.smallint_col = a2.year AND false
> RIGHT JOIN alltypes a3 ON a1.year = a1.bigint_col;
> Query: select 1
> FROM alltypestiny a1
> INNER JOIN alltypesagg a2 ON a1.smallint_col = a2.year AND false
> RIGHT JOIN alltypes a3 ON a1.year = a1.bigint_col
> Fetched 0 row(s) in 0.00s
> {noformat}
> Since the query uses a RIGHT JOIN the result have the same number of rows as the a3 table.
> Version: 1920aa5ea214ea21917778d5faad3ef1cb3e9f87
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org