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

CTAS with location qualifier overwrites directories

    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

              People

              • Assignee:
                ychena Yongzhi Chen
                Reporter:
                ychena Yongzhi Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: