我试图从卡夫卡流阿夫罗数据,并试图使用from_Avro跟随https://docs.databricks.com/spark/latest/structured-streaming/avro-dataframe.html#avro-dataframe
Getting error : not found: value from_avro
val df = spark
.readStream
.format("kafka")
.option("kafka.bootstrap.servers", servers)
.option("subscribe", "t")
.load()
.select(
from_avro($"key", SchemaBuilder.builder().stringType()).as("key"),
from_avro($"value", SchemaBuilder.builder().intType()).as("value"))
using dependencies : bijection-avro_2.12-0.9.6.jar,spark-avro_2.11-4.0.0.jar发布于 2022-01-31 22:32:57
添加此导入语句--导入org.apache.spark.sql.avro.functions._
https://stackoverflow.com/questions/51562281
复制相似问题