This commit fixes a bug that caused the program to not display an error message when saving a Spark dataframe to Snowflake. The problem was related to exception catching, which did not display errors that occurred during the save process. As a result, users were unaware of any issues with the saved data and could not take appropriate action to fix them.
To solve this problem, we have added an error handling code to the programme that detects any errors that occur during the saving process and displays an appropriate error message to the user.
With this fix, users can be confident that any errors that occur during the save process will be correctly reported, allowing them to quickly identify and fix any problems with the saved data.
Example:
column_name
data_type
id
int
execution_date
timestamp
from pyspark.sql.functions import col
df = spark.createDataFrame(
[{"id": 1, "execution_date": "202022-02-23 19:21:06"}]
).withColumn("execution_date", col("execution_date").cast("timestamp"))
df.show(truncate=False)
df.write.save(
format="snowflake",
mode="append",
)
This commit fixes a bug that caused the program to not display an error message when saving a Spark dataframe to Snowflake. The problem was related to exception catching, which did not display errors that occurred during the save process. As a result, users were unaware of any issues with the saved data and could not take appropriate action to fix them.
To solve this problem, we have added an error handling code to the programme that detects any errors that occur during the saving process and displays an appropriate error message to the user.
With this fix, users can be confident that any errors that occur during the save process will be correctly reported, allowing them to quickly identify and fix any problems with the saved data.
error: the error is not displayed![image](https://github.com/snowflakedb/spark-snowflake/assets/7476964/704caad5-d218-42fe-bd5c-3d819589fc60)
solution: the error is displayed![image](https://github.com/snowflakedb/spark-snowflake/assets/7476964/b596f465-41a4-4619-8a4d-b77e5a29eae5)