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

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

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.2
    • 4.0.0, 4.0.0-alpha-1
    • None
    • 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.1.patch
          3 kB
          Oleksiy Sayankin
        2. HIVE-18702.2.patch
          3 kB
          Oleksiy Sayankin
        3. HIVE-18702.3.patch
          19 kB
          Ivan Suller
        4. HIVE-18702.3.patch
          19 kB
          Ivan Suller
        5. HIVE-18702.4.patch
          21 kB
          Ivan Suller
        6. HIVE-18702.5.patch
          21 kB
          Ivan Suller

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            isuller Ivan Suller Assign to me
            osayankin Oleksiy Sayankin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment