unable to read kafka topic data using spark

后端 未结 2 1073
-上瘾入骨i
-上瘾入骨i 2021-01-16 18:13

I have data like below in one of the topics which I created named \"sampleTopic\"

sid,Believer  

Where the first argument is

2条回答
  •  无人共我
    2021-01-16 19:03

    spark-sql-kafka jar is missing, which is having the implementation of 'kafka' datasource.

    you can add the jar using config option or build fat jar which includes spark-sql-kafka jar. Please use relevant version of jar

    val spark = SparkSession.builder()
      .appName("SparkKafka").master("local[*]")
      .config("spark.jars","/path/to/spark-sql-kafka-xxxxxx.jar")
      .getOrCreate()
    

提交回复
热议问题