cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Databricks job getting stuck at saveAsTable

bhakti
New Contributor II

I am trying to write logs to delta table,  but after running for sometime the job is getting stuck at saveAsTable.


Traceback (most recent call last):
File "/databricks/spark/python/pyspark/errors/exceptions.py", line 228, in deco
return f(*a, **kw)
File "/databricks/spark/python/lib/py4j-0.10.9.5-src.zip/py4j/protocol.py", line 326, in get_return_value
raise Py4JJavaError(
py4j.protocol.Py4JJavaError: An error occurred while calling o3007.saveAsTable.

Any suggestions would be helpful.

7 REPLIES 7

Rishabh-Pandey
Esteemed Contributor

@bhakti looks like some permission issues is there . can you please share the code to take more reference.

Rishabh Pandey

I am using delta format to save the logs into a table as below. df.write.format("delta").mode("append").saveAsTable("table_name")

Rishabh-Pandey
Esteemed Contributor

@bhakti  @RohitKulkarni  Both can be the reason either the permission issue or schema mismatch .

Rishabh Pandey

@bhakti: Please run the below script :

try:
df.write.format("delta").mode("append").saveAsTable("table_name")
except Exception as e:
print(f"Error: {str(e)}")

and let us know the error.

Thanks

Rohit

 

RohitKulkarni
Contributor II

@bhakti : There is issue with data type mis-match.

RohitKulkarni
Contributor II

@bhakti : These is related to Data type mis-match

 

Regards

Rohit

ivanychev
Contributor II

Hey @bhakti ! Please provide the full stack trace / error message. Your log doesn't provide any strong clue, the failure during write might occur for various reasons. 

Sergey

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