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

Demyd updated HIVE-23879:
-------------------------
    Description: 
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}1. connect to hs2 by beeline"
 hive --service beeline -u "jdbc:hive2://<fqdn>:10000/;auth=maprsasl;ssl=true"

2. create test db:
 create database dbtest1 location 'maprfs:///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 'maprfs:///dbtest1a/t1';

6. insert data to table:
 insert into dbtest1.t1 (id) values (2);\{code}

Actual result:
{code}
 jdbc:hive2://<dqdn>:> select * from dbtest1.t1;
+--------+
| t1.id       |
+--------+
| 2            |
+--------+
1 row selected (0.097 seconds)
{code}
Expected result:

{code}
 jdbc:hive2://<dqdn>:> select * from dbtest1.t1;
+--------+
| t1.id       |
+--------+
| 2            |
+--------+
| 1            |
+--------+
1 row selected (0.097 seconds)
{code}
 

  was:
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:
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);



Actual result:
jdbc:hive2://<dqdn>:> select * from dbtest1.t1;+--------+
| t1.id  |
+--------+
| 2      |
+--------+
1 row selected (0.097 seconds)



Expected result:
jdbc:hive2://<fqdn>:> select * from dbtest1.t1;+--------+
| t1.id  |
+--------+
| 2      |
+--------+
| 1      |
+--------+
1 row selected (0.097 seconds)


> 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
>            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}1. connect to hs2 by beeline"
>  hive --service beeline -u "jdbc:hive2://<fqdn>:10000/;auth=maprsasl;ssl=true"
> 2. create test db:
>  create database dbtest1 location 'maprfs:///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 'maprfs:///dbtest1a/t1';
> 6. insert data to table:
>  insert into dbtest1.t1 (id) values (2);\{code}
> Actual result:
> {code}
>  jdbc:hive2://<dqdn>:> select * from dbtest1.t1;
> +--------+
> | t1.id       |
> +--------+
> | 2            |
> +--------+
> 1 row selected (0.097 seconds)
> {code}
> Expected result:
> {code}
>  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)

Reply via email to