cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Delta Live Table Pipeline to EventHub

NIK251
New Contributor II

i want to read and load the data to eventhub. And there is an error message:org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 138.0 failed 4 times, most recent failure: Lost task 0.3 in stage 138.0 (TID 177) (10.139.64.4 executor driver): java.util.concurrent.CompletionException: com.microsoft.azure.eventhubs.OperationCancelledException: Entity(anomalydetection-eventhub): send failed while dispatching to Reactor, see cause for more details.

Below is my code 

from pyspark.sql.functions import to_json, struct
 
silver_data = spark.readStream.format("delta").table("anomaydetection_processed.silver_clean_data")
 
raw_connection_string = dbutils.secrets.get(scope="anomalydetect-scope"key="connection-string-eventhub-send")
 
ehConf = {}
ehConf['eventhubs.connectionString'= spark._sc._jvm.org.apache.spark.eventhubs.EventHubsUtils.encrypt(raw_connection_string)
 
output_df = silver_data.select(to_json(struct("*")).alias("body"))
 
output_df.writeStream \
    .format("eventhubs") \
    .options(**ehConf) \
    .option("checkpointLocation""/mnt/anomalydetection2/presentation/eventhub_checkpoint") \
    .start()metrics-infor.pngmetrics-infor1.png
khang
4 REPLIES 4

Sidhant07
Databricks Employee
Databricks Employee

Hi,

The error originates from the eventhub connector. Kindly check this with the EventHub Spark connector team.

Please use the latest connector. https://github.com/Azure/azure-event-hubs-spark

There are known issues with the Event hub connector like below.
https://github.com/Azure/azure-event-hubs-spark/issues/612#issuecomment-958098093

NIK251
New Contributor II

Thanks for your response, i have checked that my cluster use the latest connector 2.3.22 and use the 15.4 LTS version. Are there any changes my error come from my cluster is in singlenode?

khang

Sidhant07
Databricks Employee
Databricks Employee

can you try with shared/multinode cluster as well to see if that resolves the issue.

I looked for similar tickets from other customers and most likely the issue is from eventhub.

NIK251
New Contributor II

sorry for the inconvenience that i cant try with multi node cluster now. Are there another ways? @@

khang

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group