0

So i am new to this. I created a partition table and was trying to insert data into it

this is my main table >>>>

CREATE TABLE test1( 
FIPS INT, Admin2 STRING, Province_State STRING, Country_Region STRING, Last_Update TIMESTAMP, Lat FLOAT, Long_ FLOAT, Confirmed INT, Deaths INT, Recovered INT, Active INT, Combined_Key STRING, Incident_Rate FLOAT, Case_Fatality_Ratio FLOAT) 
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' 

partition table >>>

create table province_state_part(country_region string, 
confirmed int, deaths int)  
PARTITIONED BY(province_state string) 
row format delimited fields terminated by ',' lines terminated by '\n' 

inserting into partition table from main >>>>

INSERT into TABLE province_state_part PARTITION(province_state) 
SELECT country_region, confirmed, deaths, province_state  
FROM test1; 

but i get this error

Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

what is this and how do i solve it ?

Koushik Roy
  • 6,868
  • 2
  • 12
  • 33
  • Find failed container logs in the job tracker and dig it deeper. there should be more informative exception message – leftjoin Feb 28 '21 at 17:38
  • `INSERT` SQL looks alright to me. So, you can try using non-partitioned table first to see if partition is the problem. – Koushik Roy Mar 01 '21 at 06:08

0 Answers0