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
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.