Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Populating Non-Partitioned Bucketed Tables

Solved Go to solution
Highlighted

Populating Non-Partitioned Bucketed Tables

New 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

Accepted Solutions

Re: Populating Non-Partitioned Bucketed Tables

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

2 REPLIES 2

Re: Populating Non-Partitioned Bucketed Tables

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

Re: Populating Non-Partitioned Bucketed Tables

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.

Don't have an account?
Coming from Hortonworks? Activate your account here