[
https://issues.apache.org/jira/browse/HIVE-11319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14905219#comment-14905219
]
Szehon Ho commented on HIVE-11319:
----------------------------------
I think its backward incompatible in the sense that there's now an exception
when trying to CTAS over a location already with data so I had marked it as
such, but I am not sure the number of people relying on this behavior. I would
say its branch-2 behavior, unless people think its not so significant for a
minor release.
> CTAS with location qualifier overwrites directories
> ---------------------------------------------------
>
> Key: HIVE-11319
> URL: https://issues.apache.org/jira/browse/HIVE-11319
> Project: Hive
> Issue Type: Bug
> Components: Parser, Security
> Affects Versions: 0.14.0, 1.0.0, 1.2.0
> Reporter: Yongzhi Chen
> Assignee: Yongzhi Chen
> Labels: backward-incompatible
> Fix For: 1.3.0, 2.0.0
>
> Attachments: HIVE-11319.1.patch, HIVE-11319.2.patch
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)