You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Ashish Sharma (Jira)" <ji...@apache.org> on 2020/11/02 07:23:00 UTC

[jira] [Resolved] (HIVE-23879) Data has been lost after table location was altered

     [ https://issues.apache.org/jira/browse/HIVE-23879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashish Sharma resolved HIVE-23879.
----------------------------------
    Resolution: Fixed

> Data has been lost after table location was altered
> ---------------------------------------------------
>
>                 Key: HIVE-23879
>                 URL: https://issues.apache.org/jira/browse/HIVE-23879
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>            Reporter: Demyd
>            Assignee: Ashish Sharma
>            Priority: Major
>
> When I alter location for not empty table and inserts data to it. I don't see old data at work with hs2. But I can find there in maprfs by old table location.
> Steps to reproduce:
> {code:sql}
> 1. connect to hs2 by beeline"
>  hive --service beeline -u "jdbc:hive2://<fqdn>:10000/;"
> 2. create test db:
>  create database dbtest1 location 'hdfs:///dbtest1.db';
> 3. create test table:
>  create table dbtest1.t1 (id int);
> 4. insert data to table:
>  insert into dbtest1.t1 (id) values (1);
> 5. set new table location:
>  alter table dbtest1.t1 set location 'hdfs:///dbtest1a/t1';
> 6. insert data to table:
>  insert into dbtest1.t1 (id) values (2);
> {code}
> Actual result:
> {code:sql}
> jdbc:hive2://<dqdn>:> select * from dbtest1.t1;
>  +--------+
> |t1.id      |
> +--------+
> |2            |
> +--------+
>  1 row selected (0.097 seconds)
> {code}
> Expected result:
> {code:sql}
> jdbc:hive2://<dqdn>:> select * from dbtest1.t1;
>  +--------+
> |t1.id      |
> +--------+
> |2            |
> +--------+
> |1            |
> +--------+
>  1 row selected (0.097 seconds)
>  {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)