1

How can we update multiple records in a table from other table using databricks delta.

I want to achieve something like :

update ExistingTable set
IsQualified = updates.IsQualified From updates  where ExistingTable.key= updates.key

It's failing with error: mismatched input 'From' expecting

zsxwing
  • 20,270
  • 4
  • 37
  • 59
Psingla
  • 21
  • 1
  • 5

3 Answers3

0
  1. Can use Merge for small dataset because it has current limit of 10k

Moreover sub queries are not supported in update statement but it is in backlog of the data bricks team.

Psingla
  • 21
  • 1
  • 5
0

Now you can do the same using 5.0 Beta or Official using MERGE INTO the 10K limit is fixed after 4.0 . I will event help with UPSERTs too if needed.

Harsha TJ
  • 264
  • 1
  • 8
0

Try using CTE and Merge

Please check the second comment in this thread.

Databricks SQL, error when running update with join

Ganesh Chandrasekaran
  • 1,578
  • 12
  • 17