[
https://issues.apache.org/jira/browse/IMPALA-6280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Tauber-Marshall resolved IMPALA-6280.
--------------------------------------------
Resolution: Fixed
Fix Version/s: Impala 2.11.0
commit 2e83ba5796d42bf3a568bfae5823896dfa644cc2
Author: Thomas Tauber-Marshall <[email protected]>
Date: Thu Dec 7 14:39:31 2017 -0800
IMPALA-6280: Materialize TupleIsNullPredicate for insert sorts
When a sort is inserted into a plan for an INSERT due to either the
target table being a Kudu table or the use of the 'clustered' hint,
and a TupleIsNullPredicate is present in the output of the sort, the
TupleIsNullPredicate may reference an incorrect tuple (i.e. not the
materialized sort tuple), leading to errors.
The solution is to materialize the TupleIsNullPredicate into the sort
tuple and then perform the appropriate expr substitutions, as is
already done for the case of analytic sorts.
Testing:
- Added an e2e test with a query that would previously fail.
Change-Id: I6c0ca717aa4321a5cc84edd1d5857912f8c85583
Reviewed-on: http://gerrit.cloudera.org:8080/8791
Reviewed-by: Alex Behm <[email protected]>
Tested-by: Impala Public Jenkins
> Invalid plan for sorted INSERT with an outer join and null checking
> -------------------------------------------------------------------
>
> Key: IMPALA-6280
> URL: https://issues.apache.org/jira/browse/IMPALA-6280
> Project: IMPALA
> Issue Type: Bug
> Components: Frontend
> Affects Versions: Impala 2.10.0
> Reporter: Alexander Behm
> Assignee: Thomas Tauber-Marshall
> Priority: Critical
> Labels: kudu, planner, regression
> Fix For: Impala 2.11.0
>
>
> Kudu DML queries may fail due to an invalid plan in the following
> circumstances:
> * Query has an outer join that involves an inline view
> * The outer-joined inline view contains NULL-checking expressions like
> COALESCE()/IFNULL()/CASE and/or constant expressions like literals
> The following error message will appear in the logs.
> {code}
> Invalid plan. TupleIsNullPredicate has invalid tuple idx.
> {code}
> Further, due to a separate issue, the coordinating impalad may crash
> (IMPALA-6262).
> This issue is a regression introduced in Impala 2.10 by the recent addition
> of partial sorting before Kudu DML. See IMPALA-5498.
> Reproduction
> {code}
> create table ktest (a int primary key, b int) stored as kudu;
> upsert into ktest
> select t1.id, v.id from functional.alltypes t1
> left outer join (select ifnull(id, 10) id from functional.alltypessmall) v
> on t1.id = v.id;
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)