我用 Avro serde 创建了一个 Hive 表。下面是我从网站复制的用于创建表格的代码。
create table NEW_TABLE
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'='{
"name": "my_record",
"type": "record",
"fields": [
{"name":"boolean1", "type":"boolean"},
{"name":"int1", "type":"int"},
{"name":"long1", "type":"long"},
{"name":"float1", "type":"float"},
{"name":"double1", "type":"double"},
{"name":"string1", "type":"string"},
{"name": "nullable_int", "type": ["int", "null"]]}');
当我发出命令来描述表格时,我收到以下错误:
hive> describe new_table;
OK
error_error_error_error_error_error_error string from deserializer
cannot_determine_schema string from deserializer
check string from deserializer
schema string from deserializer
url string from deserializer
and string from deserializer
literal string from deserializer
Time taken: 0.15 seconds, Fetched: 7 row(s)