草庐IT

AvroTypeException

全部标签

java - 失败,异常 java.io.IOException :org. apache.avro.AvroTypeException : Found long, 期望在配置单元中联合

需要帮助!!!我正在使用flume将Twitter提要流式传输到hdfs中并将其加载到hive中进行分析。步骤如下:hdfs中的数据:我已经描述了avroschema在avsc文件并将其放入hadoop中:{"type":"record","name":"Doc","doc":"adoc","fields":[{"name":"id","type":"string"},{"name":"user_friends_count","type":["int","null"]},{"name":"user_location","type":["string","null"]},{"name":

java - 读取 Avro 文件给出 AvroTypeException : missing required field error (even though the new field is declared null in schema)

我正在尝试反序列化/读取Avro文件,avro数据文件没有新字段。即使新字段在模式中声明为null,它也应该是可选的。但它仍然给我错误作为强制性的。Exceptioninthread"main"org.apache.avro.AvroTypeException:Foundcom.kiran.avro.User,expectingcom.kiran.avro.User,missingrequiredfieldlocAVRO模式声明:{"name":"loc","type":["string","null"]}使用代码读取文件:DatumReaderuserDatumReader=newS