Reply
Explorer
Posts: 13
Registered: ‎10-21-2018

how to load data into hive table(external table crated using .avsc) from avro file

I have created hive external table by using .avsc file. now I would like to load the data from avro file to the table.

 

can some one suggest how to load the data.

 

 

CREATE EXTERNAL TABLE data_hive
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
STORED as INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
LOCATION 'hdfs location to save the table'
TBLPROPERTIES ('avro.schema.url'='<avro schema location>');

Explorer
Posts: 13
Registered: ‎10-21-2018

Re: how to load data into hive table(external table crated using .avsc) from avro file

 

I tried using below command but getting error

 

hive> LOAD DATA LOCAL INPATH 'hdfs location of .avro' OVERWRITE INTO TABLE hive_from_avro_schema;
FAILED: SemanticException [Error 10028]: Line 1:23 Path is not legal ''hdfs location of .avro'': Source file system should be "file" if "local" is specified
hive>

 

Announcements
New solutions