You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Thiago Henrique dos Santos Bento <th...@b2wdigital.com> on 2014/10/08 16:51:07 UTC

Insert into hive table without overwriting data

Hi,

When I insert data into a hive table like:
Insert into hive_table
Select columns
>From another_hive_table

This query overwrite existing data. Any idea how to insert data without overwriting data?

Thiago Henrique S. Bento
B2W Digital / B2W Labs | BIT SP
thiago.bento@b2wdigital.com<ma...@b2wdigital.com>
Tel.: +55 (11) 3454-3024
.............................................................................................................................................................
B2W DIGITAL  #Americanas.com<http://americanas.com/>  #Shoptime.com<http://shoptime.com/>  #Submarino.com<http://submarino.com/>  #SouBarato.com<http://soubarato.com/>


________________________________
Esta mensagem pode conter informa??es confidenciais e somente o indiv?duo ou entidade a quem foi destinada pode utiliz?-la. A transmiss?o incorreta da mensagem n?o acarreta a perda de sua confidencialidade. Caso esta mensagem tenha sido recebida por engano, solicitamos que o fato seja comunicado ao remetente e que a mensagem seja eliminada de seu sistema imediatamente. ? vedado a qualquer pessoa que n?o seja o destinat?rio usar, revelar, distribuir ou copiar qualquer parte desta mensagem. Ambiente de comunica??o sujeito a monitoramento.

This message may include confidential information and only the intended addresses have the right to use it as is, or any part of it. A wrong transmission does not break its confidentiality. If you've received it because of a mistake or erroneous transmission, please notify the sender and delete it from your system immediately. This communication environment is controlled and monitored.

B2W Digital


Re: Insert into hive table without overwriting data

Posted by Edward Capriolo <ed...@gmail.com>.
Another way to do this is create a non-required partition.

Create table y() partitioned by (datestamp string);
insert into y (datestamp=201410100501) select * from X;

On Wed, Oct 8, 2014 at 11:45 PM, Devopam Mittra <de...@gmail.com> wrote:

> the query should not really overwrite the data. can you please check your
> hive version and also validate that your table(s) don't have dynamic
> partitioning scheme... or that you are not firing a truncate before
> inserting the data.
>
> i assume you have done the data validation already (i.e. ensuring that
> actually data is getting overwritten, and not really replicating)
>
> regards
> Dev
>
> On Wed, Oct 8, 2014 at 8:21 PM, Thiago Henrique dos Santos Bento <
> thiago.bento@b2wdigital.com> wrote:
>
>>  Hi,
>>
>>
>>
>> When I insert data into a hive table like:
>>
>> Insert into hive_table
>>
>> Select columns
>>
>> From another_hive_table
>>
>>
>>
>> This query overwrite existing data. Any idea how to insert data without
>> overwriting data?
>>
>>
>>
>> *Thiago Henrique S. Bento*
>>
>> B2W Digital / B2W Labs | BIT SP
>>
>> thiago.bento@b2wdigital.com
>>
>> Tel.: +55 (11) 3454-3024
>>
>>
>> .............................................................................................................................................................
>>
>> *B**2**W DIGITAL*  #Americanas.com <http://americanas.com/>  #
>> Shoptime.com <http://shoptime.com/>  #Submarino.com
>> <http://submarino.com/>  #SouBarato.com <http://soubarato.com/>
>>
>>
>>
>>
>>  ------------------------------
>>
>> Esta mensagem pode conter informações confidenciais e somente o indivíduo
>> ou entidade a quem foi destinada pode utilizá-la. A transmissão incorreta
>> da mensagem não acarreta a perda de sua confidencialidade. Caso esta
>> mensagem tenha sido recebida por engano, solicitamos que o fato seja
>> comunicado ao remetente e que a mensagem seja eliminada de seu sistema
>> imediatamente. É vedado a qualquer pessoa que não seja o destinatário usar,
>> revelar, distribuir ou copiar qualquer parte desta mensagem. Ambiente de
>> comunicação sujeito a monitoramento.
>>
>> This message may include confidential information and only the intended
>> addresses have the right to use it as is, or any part of it. A wrong
>> transmission does not break its confidentiality. If you've received it
>> because of a mistake or erroneous transmission, please notify the sender
>> and delete it from your system immediately. This communication environment
>> is controlled and monitored.
>>
>> B2W Digital
>>
>>
>>
>
>
>
> --
> Devopam Mittra
> Life and Relations are not binary
>

Re: Insert into hive table without overwriting data

Posted by Devopam Mittra <de...@gmail.com>.
the query should not really overwrite the data. can you please check your
hive version and also validate that your table(s) don't have dynamic
partitioning scheme... or that you are not firing a truncate before
inserting the data.

i assume you have done the data validation already (i.e. ensuring that
actually data is getting overwritten, and not really replicating)

regards
Dev

On Wed, Oct 8, 2014 at 8:21 PM, Thiago Henrique dos Santos Bento <
thiago.bento@b2wdigital.com> wrote:

>  Hi,
>
>
>
> When I insert data into a hive table like:
>
> Insert into hive_table
>
> Select columns
>
> From another_hive_table
>
>
>
> This query overwrite existing data. Any idea how to insert data without
> overwriting data?
>
>
>
> *Thiago Henrique S. Bento*
>
> B2W Digital / B2W Labs | BIT SP
>
> thiago.bento@b2wdigital.com
>
> Tel.: +55 (11) 3454-3024
>
>
> .............................................................................................................................................................
>
> *B**2**W DIGITAL*  #Americanas.com <http://americanas.com/>  #Shoptime.com
> <http://shoptime.com/>  #Submarino.com <http://submarino.com/>  #
> SouBarato.com <http://soubarato.com/>
>
>
>
>
>  ------------------------------
>
> Esta mensagem pode conter informações confidenciais e somente o indivíduo
> ou entidade a quem foi destinada pode utilizá-la. A transmissão incorreta
> da mensagem não acarreta a perda de sua confidencialidade. Caso esta
> mensagem tenha sido recebida por engano, solicitamos que o fato seja
> comunicado ao remetente e que a mensagem seja eliminada de seu sistema
> imediatamente. É vedado a qualquer pessoa que não seja o destinatário usar,
> revelar, distribuir ou copiar qualquer parte desta mensagem. Ambiente de
> comunicação sujeito a monitoramento.
>
> This message may include confidential information and only the intended
> addresses have the right to use it as is, or any part of it. A wrong
> transmission does not break its confidentiality. If you've received it
> because of a mistake or erroneous transmission, please notify the sender
> and delete it from your system immediately. This communication environment
> is controlled and monitored.
>
> B2W Digital
>
>
>



-- 
Devopam Mittra
Life and Relations are not binary