Why does format(“kafka”) fail with “Failed to find data source: kafka.” (even with uber-jar)?

前端 未结 6 1573
难免孤独
难免孤独 2020-11-30 10:23

I use HDP-2.6.3.0 with Spark2 package 2.2.0.

I\'m trying to write a Kafka consumer, using the Structured Streaming API, but I\'m getting the following error after su

6条回答
  •  死守一世寂寞
    2020-11-30 10:35

    I faced the same error. It took me a couple of days to figure out. When you copy dependency from maven repository, in particular "spark-sql-kafka", it contains the line:

     provided  
    

    The solution was to remove this line so that the dependency would run in the default "compile" scope. The same thing is true if you use SBT. It's probably worthy to remove it for other dependencies as well if they have it, just in case.

提交回复
热议问题