Tutorial : How to create avro file on Impala

Tutorial : How to create avro file on Impala

Cloudera Impala supports using tables whose data files use the Avro file format. Impala can query Avro tables, and in Impala 1.4.0 and higher can create them, but currently cannot insert data into them. For insert operations, use Hive, then switch back to Impala to run queries.

CREATE STATEMENT

invalidate metadata;
CREATE EXTERNAL TABLE Schema.tableName (Col1INT, Col2 STRING)
STORED AS AVRO
TBLPROPERTIES (‘avro.schema.literal’='{
“name”: “X”,
“type”: “record”,
“namespace”: “com.example”,
“fields”: [
{“name”:”Col1″, “type”:”int” },
{“name”:”Col2″, “type”:”string”}]}’);

LOAD THE DATA :

Leave a Reply