Insert data to partition table .

I have an un partitioned table given below.
create table unparttable ( id int, name string )
I created a partitioned table
CREATE EXTERNAL TABLE parttable ( id int, name string )
PARTITIONED BY (col_date string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS TEXTFILE LOCATION '/pathoftable';
After that I tried to copy the data over
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
INSERT OVERWRITE TABLE parttable PARTITION(date='2018-12-25')
SELECT
(
id,
name,
'2018-12-25' as col_date
) select * FROM unparttable;
but I get the below error
FAILED: NullPointerException null
What am I doing wrong?

Tagged:
Sign In or Register to comment.