| DROP TABLE IF EXISTS doctors; |
| CREATE EXTERNAL TABLE doctors |
| 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 '/drill/testdata/hive_storage/doctors' |
| TBLPROPERTIES ('avro.schema.literal'='{ |
| "namespace": "testing.hive.avro.serde", |
| "name": "doctors", |
| "type": "record", |
| "fields": [ |
| { |
| "name":"number", |
| "type":"int", |
| "doc":"Order of playing the role" |
| }, |
| { |
| "name":"first_name", |
| "type":"string", |
| "doc":"first name of actor playing role" |
| }, |
| { |
| "name":"last_name", |
| "type":"string", |
| "doc":"last name of actor playing role" |
| } |
| ] |
| }'); |