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

CTAS with location qualifier overwrites directories

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

    Description

      CTAS with location clause acts as an insert overwrite. This can cause problems when there sub directories with in a directory.
      This cause some users accidentally wipe out directories with very important data. We should ban CTAS with location to a non-empty directory.

      Reproduce:
      create table ctas1
      location '/Users/ychen/tmp'
      as
      select * from jsmall limit 10;

      create table ctas2
      location '/Users/ychen/tmp'
      as
      select * from jsmall limit 5;

      Both creates will succeed. But value in table ctas1 will be replaced by ctas2 accidentally.

      Attachments

        1. HIVE-11319.1.patch
          4 kB
          Yongzhi Chen
        2. HIVE-11319.2.patch
          4 kB
          Yongzhi Chen

        Issue Links

        Activity

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

          People

            ychena Yongzhi Chen Assign to me
            ychena Yongzhi Chen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment