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/12 11:13:00 UTC
[jira] [Updated] (IMPALA-11840) Error with joining unnest with views
[ https://issues.apache.org/jira/browse/IMPALA-11840?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Becker updated IMPALA-11840:
-----------------------------------
Description:
The following query fails:
{code:java}
use functional_parquet;
with sub as (
select id, arr1.item unnested_arr
from complextypes_arrays_only_view, complextypes_arrays_only_view.int_array_array arr1)
select id, unnested_arr from sub;
ERROR: IllegalStateException: null
{code}
The view complextypes_arrays_only_view is based on complextypestbl and if we query the table directly the query works:
{code:java}
use functional_parquet;
with sub as (
select id, arr1.item unnested_arr
from complextypestbl, complextypestbl.int_array_array arr1)
select id, unnested_arr from sub;
+----+-----------------+
| id | unnested_arr |
+----+-----------------+
| 1 | [1,2] |
| 1 | [3,4] |
| 2 | [null,1,2,null] |
| 2 | [3,null,4] |
| 2 | [] |
| 2 | NULL |
| 3 | NULL |
| 7 | NULL |
| 7 | [5,6] |
| 8 | [-1,-2] |
| 8 | [] |
+----+-----------------+
{code}
If instead of the HMS view we use an inline view it also produces an error:
{code:java}
use functional_parquet;
with arrayview as (select id, int_array_array from complextypestbl),
sub as (
select id, arr1.item unnested_arr
from arrayview, arrayview.int_array_array arr1)
select id, unnested_arr from sub;
ERROR: IllegalStateException: null
{code}
The problem seems to occur when an array is taken from a view, unnested in another view and then the result queried in an outer query. If the outer query is omitted from the first example, it works:
{code:java}
use functional_parquet;
select id, arr1.item unnested_arr
from complextypes_arrays_only_view, complextypes_arrays_only_view.int_array_array arr1;
+----+-----------------+
| id | unnested_arr |
+----+-----------------+
| 8 | [-1,-2] |
| 8 | [] |
| 1 | [1,2] |
| 1 | [3,4] |
| 2 | [null,1,2,null] |
| 2 | [3,null,4] |
| 2 | [] |
| 2 | NULL |
| 3 | NULL |
| 7 | NULL |
| 7 | [5,6] |
+----+-----------------+{code}
was:
The following query fails:
{code:java}
use functional_parquet;
with sub as (
select id, arr1.item unnested_arr
from complextypes_arrays_only_view, complextypes_arrays_only_view.int_array_array arr1)
select id, unnested_arr from sub;
ERROR: IllegalStateException: null
{code}
The view complextypes_arrays_only_view is based on complextypestbl and if we query the table directly the query works:
{code:java}
use functional_parquet;
with sub as (
select id, arr1.item unnested_arr
from complextypestbl, complextypestbl.int_array_array arr1)
select id, unnested_arr from sub;
+----+-----------------+
| id | unnested_arr |
+----+-----------------+
| 1 | [1,2] |
| 1 | [3,4] |
| 2 | [null,1,2,null] |
| 2 | [3,null,4] |
| 2 | [] |
| 2 | NULL |
| 3 | NULL |
| 7 | NULL |
| 7 | [5,6] |
| 8 | [-1,-2] |
| 8 | [] |
+----+-----------------+
{code}
If instead of the HMS view we use an inline view it also produces an error:
{code:java}
use functional_parquet;
with arrayview as (select id, int_array_array from complextypestbl),
sub as (
select id, arr1.item unnested_arr
from arrayview, arrayview.int_array_array arr1)
select id, unnested_arr from sub;
ERROR: IllegalStateException: null
{code}
The problem seems to occur when an array is taken from a view, unnested in another view and then the result queried in an outer query. If the outer query is omitted from the first example, it works:
{code:java}
use functional_parquet;
select id, arr1.item unnested_arr
from complextypes_arrays_only_view, complextypes_arrays_only_view.int_array_array arr1;
+----+-----------------+
| id | unnested_arr |
+----+-----------------+
| 8 | [-1,-2] |
| 8 | [] |
| 1 | [1,2] |
| 1 | [3,4] |
| 2 | [null,1,2,null] |
| 2 | [3,null,4] |
| 2 | [] |
| 2 | NULL |
| 3 | NULL |
| 7 | NULL |
| 7 | [5,6] |
+----+-----------------+{code}
> Error with joining unnest with views
> ------------------------------------
>
> Key: IMPALA-11840
> URL: https://issues.apache.org/jira/browse/IMPALA-11840
> Project: IMPALA
> Issue Type: Bug
> Components: Frontend
> Reporter: Daniel Becker
> Assignee: Daniel Becker
> Priority: Major
>
> The following query fails:
> {code:java}
> use functional_parquet;
> with sub as (
> select id, arr1.item unnested_arr
> from complextypes_arrays_only_view, complextypes_arrays_only_view.int_array_array arr1)
> select id, unnested_arr from sub;
> ERROR: IllegalStateException: null
> {code}
>
> The view complextypes_arrays_only_view is based on complextypestbl and if we query the table directly the query works:
> {code:java}
> use functional_parquet;
> with sub as (
> select id, arr1.item unnested_arr
> from complextypestbl, complextypestbl.int_array_array arr1)
> select id, unnested_arr from sub;
> +----+-----------------+
> | id | unnested_arr |
> +----+-----------------+
> | 1 | [1,2] |
> | 1 | [3,4] |
> | 2 | [null,1,2,null] |
> | 2 | [3,null,4] |
> | 2 | [] |
> | 2 | NULL |
> | 3 | NULL |
> | 7 | NULL |
> | 7 | [5,6] |
> | 8 | [-1,-2] |
> | 8 | [] |
> +----+-----------------+
> {code}
>
> If instead of the HMS view we use an inline view it also produces an error:
> {code:java}
> use functional_parquet;
> with arrayview as (select id, int_array_array from complextypestbl),
> sub as (
> select id, arr1.item unnested_arr
> from arrayview, arrayview.int_array_array arr1)
> select id, unnested_arr from sub;
> ERROR: IllegalStateException: null
>
> {code}
>
> The problem seems to occur when an array is taken from a view, unnested in another view and then the result queried in an outer query. If the outer query is omitted from the first example, it works:
> {code:java}
> use functional_parquet;
> select id, arr1.item unnested_arr
> from complextypes_arrays_only_view, complextypes_arrays_only_view.int_array_array arr1;
> +----+-----------------+
> | id | unnested_arr |
> +----+-----------------+
> | 8 | [-1,-2] |
> | 8 | [] |
> | 1 | [1,2] |
> | 1 | [3,4] |
> | 2 | [null,1,2,null] |
> | 2 | [3,null,4] |
> | 2 | [] |
> | 2 | NULL |
> | 3 | NULL |
> | 7 | NULL |
> | 7 | [5,6] |
> +----+-----------------+{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