avro/avsc文件抛出

hgtggwj0  于 2021-06-26  发布在  Hive
关注(0)|答案(0)|浏览(294)

我有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>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题