我有avsc文件,我正在尝试使用如下创建表,但是收到错误。
CREATE 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'
TBLPROPERTIES ('avro.schema.literal'='{
"namespace": "ly.stealth.xmlavro",
"types": [ {
"name": "Attribute", "type": "record",
"fields": [
{"name": "name", "type": "string"},
{"name": "value", "type": "string" }
]
}, {
"name": "Element",
"type": "record", "fields": [
{"name": "name", "type": "string"},
{"name": "attributes", "type": {"type": "array", "items": "Attribute"}},
{"name": "children", "type": {"type": "array", "items": ["Element", "string"]} }
]
}
]
}
');
错误如下:
*FAILED: Execution Error, return
code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException:
MetaException(message:org.apache.hadoop.hive.serde2.SerDeException Encountered
exception determining schema. Returning signal schema to indicate problem: No
type:
{"namespace":"ly.stealth.xmlavro","protocol":"xml","types": [{"name":"Attribute","type":"record","fields":[{"name":"name","type":"string"}, {"name":"value","type":"string"}]}, {"name":"Element","type":"record","fields":[{"name":"name","type":"string"},{"name":"attributes","type":{"type":"array","items":"Attribute"}},{"name":"children","type":{"type":"array","items":["Element","string"]}}]}]})
hive>