Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hadoop 使用avro serde创建配置单元表时出错_Hadoop_Hive_Avro - Fatal编程技术网

Hadoop 使用avro serde创建配置单元表时出错

Hadoop 使用avro serde创建配置单元表时出错,hadoop,hive,avro,Hadoop,Hive,Avro,我的同事在使用avro serde创建配置单元表时出错。下面是他尝试的代码,结果出错 DROP TABLE IF EXISTS twitter; CREATE TABLE twitter ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFo

我的同事在使用avro serde创建配置单元表时出错。下面是他尝试的代码,结果出错

   DROP TABLE IF EXISTS twitter;
    CREATE TABLE twitter
    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'='{
    "type" : "record",
    "name" : "twitter_schema",
    "namespace" : "com.miguno.avro",
    "fields" : [ {
    "name" : "username",
    "type" : "string",
    "doc" : "Name of the user account on Twitter.com"},
    {"name" : "tweet",
    "type" : "string",
    "doc" : "The content of the user's Twitter message"},  
    {"name" : "timestamp",
     "type" : "long",
     "doc" : "Unix epoch time in seconds"}
     ],"doc:" : "A basic schema for storing Twitter messages"}');
我后来发现,第17行中的撇号“'”导致了这个问题

"doc" : "The content of the user's Twitter message"},

在上面的一行中,文档注释包含了一个带撇号的单词。我把它取了下来,效果很好。

你想问个问题吗?不,这是我在创建蜂巢表时遇到的问题。只是想创造一种意识。@AlexRaj,你应该给自己的问题添加一个答案,而不是在“问题”字段中回答问题。:)