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 ?

2
  • Find failed container logs in the job tracker and dig it deeper. there should be more informative exception message Commented Feb 28, 2021 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. Commented Mar 1, 2021 at 6:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.