Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Populating Non-Partitioned Bucketed Tables

avatar
Contributor

Hi Gurus,

It may not be practical question, however, I am wandering, if it is possible to load data in a Bucketed Table (Non-Partitioned) through insert-overwrite.

I am getting NullPointerException while I am trying to do so.

CREATE TABLE my_stg.mytable1 ( 
         employee_id int,
         employee_name string,
         dept STRING, 
         country STRING
          ) 
CLUSTERED BY (employee_id) INTO 256 BUCKETS
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',';
set hive.enforce.bucketing = true;
INSERT OVERWRITE TABLE my_stg.mytable1 SELECT employee_id,employee_name,dept,country FROM my_stg.mytable;
FAILED: NullPointerException null

Thanks,

Soumya

1 ACCEPTED SOLUTION

avatar
Super Guru

possibly you are hitting https://issues.apache.org/jira/browse/HIVE-10776, could you please share the complete exception

View solution in original post

2 REPLIES 2

avatar
Super Guru

possibly you are hitting https://issues.apache.org/jira/browse/HIVE-10776, could you please share the complete exception

avatar
New Contributor

I too got the same exception while insert overwrite to a bucketed table by selecting data from a partitioned table.

I applied a work around to get around this problem.

1. First insert the data to a non partitioned temp table

2.select the data from the temp table and insert it to the bucketed table

This solved the problem for me.