Loading in path file to a partitioned table

Viewed 3878

I'm trying to load a file locally into Hive by running this command:

LOAD DATA INPATH '/data/work/hive/staging/ExampleData.csv' INTO TABLE tablename;

which gives me the error:

SemanticException [Error 10062]: Need to specify partition columns because the destination table is partitioned (state=42000,code=10062)

An answer I found suggests creating an intermediate table then letting dynamic partitioning kick in to load into a partitioned table.

I've created a table that matches the data and truncated it:

create table temptablename as select * from tablename;
truncate table temptablename

Then loaded the data using:

LOAD DATA INPATH '/data/work/hive/staging/ExampleData.csv' INTO TABLE temptablename;

How do I 'kick in' dynamic partitioning?

1 Answers
Related