hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carter Shanklin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-17013) Delete request with a subquery based on select over a view
Date Tue, 04 Jul 2017 16:41:00 GMT

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

Carter Shanklin commented on HIVE-17013:
----------------------------------------

[~ekoifman]

I'm seeing this as well.

Oddly even the explain errors out. Any idea what's going on here?

{code}
hive> delete from mydim where mydim.key in (select key from updates_staging_view);
FAILED: IllegalStateException Expected 'insert into table default.mydim select ROW__ID from
default.mydim sort by ROW__ID' to be in sub-query or set operation.
hive> explain delete from mydim where mydim.key in (select key from updates_staging_view);
FAILED: IllegalStateException Expected 'insert into table default.mydim select ROW__ID from
default.mydim sort by ROW__ID' to be in sub-query or set operation.
hive> select version();
OK
2.1.0.2.6.1.0-128 rd62a574991e4068c4ae7124aa35f4fbf36a12fc1
Time taken: 0.07 seconds, Fetched: 1 row(s)
{code}

> Delete request with a subquery based on select over a view
> ----------------------------------------------------------
>
>                 Key: HIVE-17013
>                 URL: https://issues.apache.org/jira/browse/HIVE-17013
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Frédéric ESCANDELL
>            Priority: Blocker
>
> Hi, 
> I based my DDL on this exemple https://fr.hortonworks.com/tutorial/using-hive-acid-transactions-to-insert-update-and-delete-data/.
> In a delete request, the use of a view in a subquery throw an exception : 
> FAILED: IllegalStateException Expected 'insert into table default.mydim select ROW__ID
from default.mydim sort by ROW__ID' to be in sub-query or set operation.
> {code}
> {code:sql}
> drop table if exists mydim;
> create table mydim (key int, name string, zip string, is_current boolean)
> clustered by(key) into 3 buckets
> stored as orc tblproperties ('transactional'='true');
> insert into mydim values
>   (1, 'bob',   '95136', true),
>   (2, 'joe',   '70068', true),
>   (3, 'steve', '22150', true);
> drop table if exists updates_staging_table;
> create table updates_staging_table (key int, newzip string);
> insert into updates_staging_table values (1, 87102), (3, 45220);
> drop view if exists updates_staging_view;
> create view updates_staging_view (key, newzip) as select key, newzip from updates_staging_table;
> delete from mydim
> where mydim.key in (select key from updates_staging_view);
> FAILED: IllegalStateException Expected 'insert into table default.mydim select ROW__ID
from default.mydim sort by ROW__ID' to be in sub-query or set operation.
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message