hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "xinzhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-19756) Insert request with UNION ALL and lateral view explode
Date Thu, 28 Mar 2019 08:40:00 GMT

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

xinzhang commented on HIVE-19756:
---------------------------------

please set the config :

set hive.optimize.index.filter=false;

> Insert request with UNION ALL and lateral view explode
> ------------------------------------------------------
>
>                 Key: HIVE-19756
>                 URL: https://issues.apache.org/jira/browse/HIVE-19756
>             Project: Hive
>          Issue Type: Bug
>         Environment: HDP 2.6.4
>            Reporter: Frédéric ESCANDELL
>            Priority: Major
>
> Hi,
> While executing this code snippet, no data was inserted in the final table t3.
> By replacing UNION ALL by UNION or removing the "lateral view explode" the code works
properly.
>  
> {code:sql}
> DROP table t1;
> DROP table t2;
> DROP table t3;
> CREATE TABLE t1(cle string,valeur array<struct<v:string>>)
>     ROW FORMAT SERDE  'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
>     STORED AS 
>       INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
>       OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
> INSERT INTO table t1 select * from (select "a",array(named_struct('v','x'), named_struct('v','y')))
tmp;
>  CREATE TABLE t2(cle string,valeur array<struct<v:string>>)
>     ROW FORMAT SERDE  'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
>     STORED AS 
>       INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
>       OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
> INSERT INTO table t2 select * from (select "b",array(named_struct('v','z'), named_struct('v','w')))
tmp;
> DROP view v1;
> DROP table t3;
> CREATE VIEW v1 (cle,valeur) 
> AS
> select base.cle,val.v from (select cle,valeur from t1) as base
> lateral view explode(base.valeur) a as val
> union all
> select base1.cle,val.v from (select cle,valeur from t2) as base1
> lateral view explode(base1.valeur) a as val;
>  CREATE TABLE t3(cle string,valeur string)
>     ROW FORMAT SERDE  'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
>     STORED AS 
>       INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
>       OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
> insert into t3 
> select * from v1;
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message