如何从 kafka 读取 Avro Schema 类型的事件并将它们存储在 Hive Table
How to read Avro Schema-typed Events from kafka and store them in a Hive Table
我的想法是将 Spark Streaming + Kafka to get the events from the kafka bus. After retrieving a batch of avro-encoded events I would like to transform them with Spark Avro 用于 SparkSQL 数据帧,然后将数据帧写入 Hive Table。
这种方法可行吗?我是 spark 的新手,我不确定我是否可以使用 Spark Avro 包来解码 Kafka 事件,因为在文档中只提到了 avro 文件。但目前我的理解是,这是可能的。
下一个问题是:如果可能的话,我的理解是,我有一个符合 SparkSQL 标准的 Dataframe,我可以将其写入配置单元 table。我的假设是否正确?
提前感谢您提供任何提示和技巧。
是的,你可以做到
http://aseigneurin.github.io/2016/03/04/kafka-spark-avro-producing-and-consuming-avro-messages.html
可以将数据集保存为hive tables或将数据写入orc format.You也可以将数据以所需格式写入hdfs并创建外部hive table除此之外
我的想法是将 Spark Streaming + Kafka to get the events from the kafka bus. After retrieving a batch of avro-encoded events I would like to transform them with Spark Avro 用于 SparkSQL 数据帧,然后将数据帧写入 Hive Table。
这种方法可行吗?我是 spark 的新手,我不确定我是否可以使用 Spark Avro 包来解码 Kafka 事件,因为在文档中只提到了 avro 文件。但目前我的理解是,这是可能的。
下一个问题是:如果可能的话,我的理解是,我有一个符合 SparkSQL 标准的 Dataframe,我可以将其写入配置单元 table。我的假设是否正确?
提前感谢您提供任何提示和技巧。
是的,你可以做到 http://aseigneurin.github.io/2016/03/04/kafka-spark-avro-producing-and-consuming-avro-messages.html
可以将数据集保存为hive tables或将数据写入orc format.You也可以将数据以所需格式写入hdfs并创建外部hive table除此之外