标签:code prope ros mail example data string row create
create table customer
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 ‘/datalake/raw/customer‘
tblproperties (
‘avro.schema.literal‘=‘{
"namespace": "example.avro",
"type": "record",
"name": "Customer",
"fields": [
{"name":"id", "type":"int"},
{"name":"first_name", "type":"string"},
{"name":"last_name", "type":"string"},
{"name":"dob", "type":"long"}
]
}‘);
create table address
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 ‘/datalake/raw/address‘
tblproperties (
‘avro.schema.literal‘=‘{
"namespace": "example.avro",
"type": "record",
"name": "Address",
"fields": [
{"name":"id", "type":"int"},
{"name":"street1", "type":"string"},
{"name":"street2", "type":"string"},
{"name":"city", "type":"string"},
{"name":"state", "type":"string"},
{"name":"country", "type":"string"},
{"name":"zip_pin_postal_code", "type":"string"}
]
}‘);
create table contact
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 ‘/datalake/raw/contacts/load1‘
tblproperties (
‘avro.schema.literal‘=‘{
"namespace": "example.avro",
"type": "record",
"name": "Contact",
"fields": [
{"name":"id", "type":"string"},
{"name":"cell", "type":"string"},
{"name":"phone", "type":"string"},
{"name":"email", "type":"string"}
]
}‘);
标签:code prope ros mail example data string row create
原文地址:https://www.cnblogs.com/rigid/p/14472230.html