Read/Write concurrency issue
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2022 08:16 AM
Hi.
I assume that it can be concurrency issue. (a Read thread from Databricks and a Write thread from another system)
From the start:
- I read 12-16 csv files (approximately 250Mb each of them) to dataframe. df = spark.read.option("header", "False").option("delimiter", ',').option('quote','"').option("multiLine","true").option("escape", "\"").option("dateFormat", "yyyy-MM-dd'T'HH:mm:ss'Z'").schema(schema).csv(partition_list)
- Print count of rows. print(df.count())
- Save dataframe to database. df.write.format('delta').mode('overwrite').option("overwriteSchema","true").saveAsTable(f"{db_name}.{table_name}")
This process is running once a day.
Sometimes I receive this error: "An error occurred while calling oXXXX.saveAsTable" (First 2 steps always work correct).
There is one important moment: when I read these files from ADLS, some of them can be overwritten by another system (according to file's LastModified date in storage).
I will add error output in attachment.
Do you know what can occur this error and how it can be solved?
Labels:
- Labels:
-
Concurrency
-
Databricks