Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

Error - while writing to Sql DB #204

@akhilkoesis

Description

@akhilkoesis

Hi,

Getting following error while writing df to sql server -

org.apache.spark.SparkException: Job aborted due to stage failure: Task 27 in stage 3.0 failed 4 times, most recent failure: Lost task 27.3 in stage 3.0 (TID 202) (10.40.64.38 executor 0): com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.

Code -

url = server_name + ":1433;" + "databaseName=" + database_name + ";"

df.write
.format("com.microsoft.sqlserver.jdbc.spark")
.mode("overwrite")
.option("driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
.option("url", url)
.option("dbtable", table_name)
.option("user", username)
.option("password", password)
.save()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions