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

INSERT OVERWRITE TABLE doesn't clean the table directory before overwriting

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 4.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Enable Hive on TEZ. (MR works fine).

      STEP 1. Create test data

      nano /home/test/users.txt
      

      Add to file:

      Peter,34
      John,25
      Mary,28
      
      hadoop fs -mkdir /bug
      hadoop fs -copyFromLocal /home/test/users.txt /bug
      hadoop fs -ls /bug
      

      EXPECTED RESULT:

      Found 2 items                                                                   
      -rwxr-xr-x   3 root root         25 2015-10-15 16:11 /bug/users.txt
      

      STEP 2. Upload data to hive

      create external table bug(name string, age int) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' LOCATION '/bug';
      select * from bug;
      

      EXPECTED RESULT:

      OK
      Peter   34
      John    25
      Mary    28
      
      create external table bug1(name string, age int) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' LOCATION '/bug1';
      insert overwrite table bug select * from bug1;
      select * from bug;
      

      EXPECTED RESULT:

      OK
      Time taken: 0.097 seconds
      

      ACTUAL RESULT:

      hive>  select * from bug;
      OK
      Peter	34
      John	25
      Mary	28
      Time taken: 0.198 seconds, Fetched: 3 row(s)
      

        Attachments

        1. HIVE-18702.5.patch
          21 kB
          Ivan Suller
        2. HIVE-18702.4.patch
          21 kB
          Ivan Suller
        3. HIVE-18702.3.patch
          19 kB
          Ivan Suller
        4. HIVE-18702.3.patch
          19 kB
          Ivan Suller
        5. HIVE-18702.2.patch
          3 kB
          Oleksiy Sayankin
        6. HIVE-18702.1.patch
          3 kB
          Oleksiy Sayankin

          Issue Links

            Activity

              People

              • Assignee:
                isuller Ivan Suller
                Reporter:
                osayankin Oleksiy Sayankin
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: