NiFi:传入的流文件不能作为 Avro 文件读取

NiFi: The incoming flow file can not be read as an Avro file

我刚开始使用 NiFi 1.4。

我正在尝试通过 kafka 将管道分隔的消息发送到 Hive。所以我正在使用 ConsumeKafkaRecord_0_10 和 PutHivStreaming 处理器。 Consume Kafka reader 将成功数据发送到 PutHiveStreaming。

使用 Kafka reader 以 avro 格式写入数据,但 PutHiveStreaming 给出错误

The incoming flow file can not be read as an Avro filee: java.io.IOException: Not a data file."

PutHiveStreaming 只能读取 Avro 数据文件,因此您必须确保 ConsumeKafkaRecord 使用的 writer 是一个 AvroRecordSetWriter,Schema Write Strategy 设置为 Embedded Schema。

如果架构未嵌入,那么当它到达 Hive 处理器时,它将不是有效的 Avro 数据文件。