[ 
https://issues.apache.org/jira/browse/IMPALA-10752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17812515#comment-17812515
 ] 

ASF subversion and git services commented on IMPALA-10752:
----------------------------------------------------------

Commit 46f04313212952ae2e8f432cb622457918bae6cd in impala's branch 
refs/heads/master from Daniel Becker
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=46f043132 ]

IMPALA-12763: Union with string struct crashes in ASAN

In ASAN builds, if we UNION ALL an array containing a struct of a string
with itself, Impala crashes. This is how to reproduce it:

In Hive:
  create table su (arr ARRAY<STRUCT<s: STRING>>) stored as parquet;
  insert into su values (array(named_struct("s", "A")));

In Impala:
  select 1, arr from su
    union all select 2, arr from su;

The ASAN error message indicates a heap-use-after-free.

Normally, UNIONs of structs are not supported yet (see IMPALA-10752),
but if the struct is inside an array it is allowed now. This was
probably not intentional and it leads to the above error, so this change
disables structs in unions completely, including embedded structs.

Testing:
 - adjusted existing tests
 - added a query that tests that types with embedded structs are not
   allowed in a UNION statement, in mixed-collections-and-structs.test

Change-Id: Id728f1254b74636be594a33313a478b0b77c7ae4
Reviewed-on: http://gerrit.cloudera.org:8080/20970
Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


> Support for UNION two structs
> -----------------------------
>
>                 Key: IMPALA-10752
>                 URL: https://issues.apache.org/jira/browse/IMPALA-10752
>             Project: IMPALA
>          Issue Type: New Feature
>          Components: Backend, Frontend
>            Reporter: Gabor Kaszab
>            Priority: Major
>
> {code:java}
> select id, tiny_struct from complextypes_structs
> union all
> select id, tiny_struct from complextypes_structs;
> {code}
> Result is the following error:
> {code:java}
> ERROR: AnalysisException: Incompatible return types 'STRUCT<b:BOOLEAN>' and 
> 'STRUCT<b:BOOLEAN>' of exprs 'tiny_struct' and 'tiny_struct'.
> {code}
> where complextypes_structs is the following (note, it is same with parquet):
> {code:java}
> CREATE TABLE complextypes_structs (
>     id int,
>     tiny_struct struct<b:boolean>,
>     small_struct struct<i:int, s:string>
> ) STORED AS ORC;
> {code}



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

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

Reply via email to