You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Sumit Agrawal <su...@continuity1.com> on 2020/04/05 15:09:03 UTC
Spark, read from Kafka stream failing AnalysisException
Hello,
I am using Spark 2.4.5, Kafka 2.3.1 on my local machine.
I am able to produce and consume messages on Kafka with bootstrap server config "localhost:9092”
While trying to setup reader with spark streaming API, I am getting an error as
Exception Message:
Py4JJavaError: An error occurred while calling o166.load.
: org.apache.spark.sql.AnalysisException: Failed to find data source: kafka. Please deploy the application as per the deployment section of "Structured Streaming + Kafka Integration Guide".;
Spark Code I am trying to execute:
df1 = spark.readStream.format("kafka")\
.option("kafka.bootstrap.servers", "localhost:9092")\
.option("subscribe", "topic1")\
.load()
Any guidelines would help.
Regards,
Sumit
---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org
Re: Spark, read from Kafka stream failing AnalysisException
Posted by Tathagata Das <ta...@gmail.com>.
Have you looked at the suggestion made by the error by searching for
"Structured Streaming + Kafka Integration Guide" in Google? It should be
the first result.
The last section
<https://spark.apache.org/docs/latest/structured-streaming-kafka-integration.html#deploying>
in the "Structured Streaming + Kafka Integration Guide" specifies how to
add the spark-sql-kafka maven dependency when starting pyspark.
On Sun, Apr 5, 2020 at 11:11 AM Sumit Agrawal <su...@continuity1.com> wrote:
> Hello,
>
> I am using Spark 2.4.5, Kafka 2.3.1 on my local machine.
>
> I am able to produce and consume messages on Kafka with bootstrap server
> config "localhost:9092”
>
> While trying to setup reader with spark streaming API, I am getting an
> error as
>
> Exception Message:
> Py4JJavaError: An error occurred while calling o166.load.
> : org.apache.spark.sql.AnalysisException: Failed to find data source:
> kafka. Please deploy the application as per the deployment section of
> "Structured Streaming + Kafka Integration Guide".;
>
> Spark Code I am trying to execute:
> df1 = spark.readStream.format("kafka")\
> .option("kafka.bootstrap.servers", "localhost:9092")\
> .option("subscribe", "topic1")\
> .load()
>
> Any guidelines would help.
>
> Regards,
> Sumit
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe e-mail: user-unsubscribe@spark.apache.org
>
>