Giter VIP home page Giter VIP logo

Comments (10)

gerardwolf avatar gerardwolf commented on May 16, 2024 1

Certainly looks like it is caused by the name of the temp staging table not being granular enough. Adding the sink table name to the temp table should resolve this yes.

from sql-spark-connector.

pramodnagare avatar pramodnagare commented on May 16, 2024

Hi ankitbko
Try adding below option, it will solve your table lock issue.

option("tableLock", True)

from sql-spark-connector.

ankitbko avatar ankitbko commented on May 16, 2024

@pramodnagare tablelock option is meant to be used with heap tables only. tablelock option is set to true automatically for staging tables.

val newOptions = new SQLServerBulkJdbcOptions(options.parameters + ("tableLock" -> "true"))

cc: @shivsood

from sql-spark-connector.

bunkersdev avatar bunkersdev commented on May 16, 2024

Hello, I am encountering the same issue. I need to use the following options
.option("schemaCheckEnabled", False) \ .option("reliabilityLevel","NO_DUPLICATES") \

@shivsood

from sql-spark-connector.

bunkersdev avatar bunkersdev commented on May 16, 2024

Any update on this ?

from sql-spark-connector.

shivsood avatar shivsood commented on May 16, 2024

@ankitbko does this happen only on databricks? Can u send repro step and your scripts for us to repro this. @luxu1-ms as FYI

from sql-spark-connector.

gerardwolf avatar gerardwolf commented on May 16, 2024

I also encounter this issue when running multiple instances of the same notebook on the same cluster (DBR 7.3 LTS) using Azure Databricks. My notebook attempts to load data from delta lake table source and overwrite the data in an existing Azure SQL Database table using the following options:

try: dfSource.write \ .format("com.microsoft.sqlserver.jdbc.spark") \ .mode("overwrite") \ .option("url", url) \ .option("dbtable", sinkTable) \ .option("user", userName) \ .option("password", password) \ .option("truncate", "true") \ .option("tablock", "true") \ .option("schemaCheckEnabled", "false") \ .option("batchsize", batchsize) \ .option("reliabilityLevel", "NO_DUPLICATES") \ .save() except ValueError as error : print("Connector write failed", error)

The intent is to preserve the table definition (and indexes) in the sink database. I realise the tablock is only required for heaps, but this is a generic notebook that loads to both indexed and heap tables.
Importantly, I don't get an error when I run the notebook in isolation, so it appears that there is some shared global temp table that is causing deadlocks in parallel execution scenario.

from sql-spark-connector.

luxu1-ms avatar luxu1-ms commented on May 16, 2024

I think gerardwolf's issue is different from #49, but related with #132.

from sql-spark-connector.

luxu1-ms avatar luxu1-ms commented on May 16, 2024

@ankitbko Could you please provide repro scripts? I am not able to repro this issue.

from sql-spark-connector.

luxu1-ms avatar luxu1-ms commented on May 16, 2024

Close this issue since no more info provided and cannot repro it. Please reopen if more info provided.

from sql-spark-connector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.