Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23879

Data has been lost after table location was altered

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • Metastore
    • None

    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:

      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://<dqdn>:> select * from dbtest1.t1;
       +--------+
      |t1.id      |
      +--------+
      |2            |
      +--------+
      |1            |
      +--------+
       1 row selected (0.097 seconds)
       

       

      Attachments

        Activity

          People

            ashish-kumar-sharma Ashish Sharma
            bb8core Demyd
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: