hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Demyd (Jira)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-23879) Data has been lost after table location was altered
Date Mon, 20 Jul 2020 07:32:00 GMT

     [ 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: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}
 

  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:
{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}
{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}
 


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

Mime
View raw message