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 "Daniel Becker (Jira)" <ji...@apache.org> on 2023/01/06 17:07:00 UTC

[jira] [Created] (IMPALA-11828) Incorrect result of joining unnest with view

Daniel Becker created IMPALA-11828:
--------------------------------------

             Summary: Incorrect result of joining unnest with view
                 Key: IMPALA-11828
                 URL: https://issues.apache.org/jira/browse/IMPALA-11828
             Project: IMPALA
          Issue Type: Bug
            Reporter: Daniel Becker
            Assignee: Daniel Becker


If an array-typed column comes from a view or an inline view and is unnest-joined with itself, the (non-unnested) array column in the result will contain NULLs instead of the arrays.

The following queries both produce incorrect results. Note that {{complextypes_arrays_only_view}} is a view on {{complextypestbl}} so these queries are functionally equivalent:

 
{code:java}
use functional_parquet;
with sub as (select int_array from complextypestbl) select int_array, a.item from sub, sub.int_array a;{code}
 
{code:java}
use functional_parquet;
select int_array, a.item from complextypes_arrays_only_view, complextypes_arrays_only_view.int_array a;{code}
 

 
{code:java}
+-----------+------+
| int_array | item |
+-----------+------+
| NULL      | -1   |
| NULL      | 1    |
| NULL      | 2    |
| NULL      | 3    |
| NULL      | NULL |
| NULL      | 1    |
| NULL      | 2    |
| NULL      | NULL |
| NULL      | 3    |
| NULL      | NULL |
+-----------+------+{code}
 

If no views are involved and the table is queried directly, the result is correct:
{code:java}
use functional_parquet;
select int_array, a.item from complextypestbl, complextypestbl.int_array a;{code}
{code:java}
+------------------------+------+
| int_array              | item |
+------------------------+------+
| [-1]                   | -1   |
| [1,2,3]                | 1    |
| [1,2,3]                | 2    |
| [1,2,3]                | 3    |
| [null,1,2,null,3,null] | NULL |
| [null,1,2,null,3,null] | 1    |
| [null,1,2,null,3,null] | 2    |
| [null,1,2,null,3,null] | NULL |
| [null,1,2,null,3,null] | 3    |
| [null,1,2,null,3,null] | NULL |
+------------------------+------+{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org