I think ³it should overwrite the entire table² makes more sense.
One can reasonably expect that
³insert overwrite table t partition (pk)
   select 1 as val, key from src where key > 20;²  should actually be
written as

³insert overwrite table t
   select 1 as val, key from src where key > 20;²

and for Hive to know partition columns.
With this syntax the ³overwrite the entire table² is more intuitive.



On 10/17/16, 7:29 PM, "Sushanth Sowmyan" <khorg...@gmail.com> wrote:

>I expect the following because it follows per-ptn if-write-then-overwrite
>semantics:
>
>0,10
>1,25
>1,50
>
>There can be a case to be made that it should overwrite the entire table,
>and that would make sense too(probably more sense than this one), but not
>one I'd think we should switch behavior to(backward compatibility).
>
>On Oct 17, 2016 18:10, "Sergey Shelukhin" <ser...@hortonworks.com> wrote:
>
>> What do you think this SHOULD do?
>>
>> > select key from src;
>> 10
>> 25
>> 50
>>
>> > create table t(val int) partitioned by (pk int);
>> > insert overwrite table t partition (pk)
>>   select 0 as val, key from src where key < 30;
>> > insert overwrite table t partition (pk)
>>   select 1 as val, key from src where key > 20;
>>
>>
>> > select val, pk from t;
>> ?
>>
>>

Reply via email to