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:ย 

Dataframe to update subset of fields in table...

plynton
New Contributor II

I have a table that I'll update with multiple inputs (csv). Is there a simple way to update my target when the source fields won't be a 1:1 match? Another challenge I've run into is that my sources don't have a header field, though I guess I could rename the columns if this would be beneficial.

At this point, I've created a blank dataframe based on a schema and then tried to .copy the source columns into the empty df. However, when I do this I get a warning from DB telling me that this is inefficient.

Any help greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Hubert-Dudek
Esteemed Contributor III

Read your CSV as a dataframe and than make update using Merge (upsert).

View solution in original post

1 REPLY 1

Hubert-Dudek
Esteemed Contributor III

Read your CSV as a dataframe and than make update using Merge (upsert).

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