Reply
Expert Contributor
Posts: 76
Registered: ‎11-24-2017

Cannot create parquet/text table from JsonSerde table

Hi everyone, I have a simple table based on JsonSerde:

 

CREATE EXTERNAL TABLE person
(
	name string,
	age int,
	phones array<string>
)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
STORED AS TEXTFILE
LOCATION '/user/cloudera/tables/person';

The structure of json data is the following:

 

{"name": "Pollos", "age": 1, "phones": [1,2,3]}
{"name": "Hermanos", "age": 2, "phones": [4,5,6]}

I can query this table without errors:

q.png

 

 

But when I try to create a parquet or a normal text table from this one I got error:

 

CREATE EXTERNAL TABLE person_parquet
(
	name STRING,
	age INT,
	phones ARRAY<STRING>
)
STORED AS PARQUET
LOCATION '/user/cloudera/tables/person_parquet';


INSERT OVERWRITE TABLE person_parquet SELECT * FROM person;

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

 

 

Is this a known issue or am I doing something wrong?

 

Thanks for any help!

Announcements