I am using Kafka+Spark integration where I am sending case class object (Website) and map into spark.
case class Website(id: Int, name: String)
implicit val productSchema = Encoders.product[Website]
val website = Website(1,"lokesh")
EmbeddedKafka.publishToKafka(topic, website.toString)(config,new StringSerializer)
val df:Dataset[Website] = spark
.readStream
.format("kafka")
.option("subscribe", topic)
.option("kafka.bootstrap.servers", "localhost:1244")
.option("startingoffsets", "earliest")
.load()
.select("value")
.as[Website]
I get the error
Exception in thread "main" org.apache.spark.sql.AnalysisException: cannot resolve '
id' given input columns: [value];