One record insert to hive partitioned table

I want to insert one record to a hive partitioned table:

The table desc is given below:

name                    string                  None                
id                      string                  None                
work_done               string                  None                

# Partition Information      
# col_name              data_type               comment             

work_done               string                  None

The table consist few records and I want want to append a new record to the table.

Given below is the code I write to insert record.

insert into table work_details_join_part partition (work_done) 
    select 'sammy', 'sam002', 'Assignment' from dual;

After writing the above command I get an error:

SemanticException [Error 10096]: Dynamic partition strict mode requires at least one     static partition column. To turn this off set hive.exec.dynamic.partition.mode=nonstrict

To avoid this I wrote the following command and then executed my insert command, Even then I get the same error repeatedly.

set exec.dynamic.partition=true;                                                                           
set exec.dynamic.partition.mode=nonstrict;

Please do guide me. Thanks in advance:)

Answers


Perhaps just rewrite it to be a non-dynamic insert like:

insert into table work_details_join_part partition (work_done='Assignment') 
select 'sammy', 'sam002' from dual;

However hive is terrible for single record inserts so expect really bad performance. Also keep in mind each time you run this query 1 single small file with 1 record will be added to hdfs making this a directory full of tiny files (this is really bad).


Need Your Help

Sort and limit queryset by comment count and date using queryset.extra() (django)

python sql mysql django

I am trying to sort/narrow a queryset of objects based on the number of comments each object has as well as by the timeframe during which the comments were posted. Am using a queryset.extra() meth...

How to set the cursor position of a text box on click

c# textbox cursor position

I'm required to have a textbox pre-filled with some text, and want the cursor to default to the beginning of the textbox when it is focused.