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: 

Copying file from DBFS to a table of Databricks, Is there a way to get the errors at record level ?

inagar
New Contributor

We have file of data to be ingested into a table of Databricks. Following below approach,

  1. Uploaded file to DBFS
  2. Creating a temporary table and loading above file to the temporary table. CREATE TABLE [USING] 
  3. Use MERGE INTO to merge temp_table created in step2 with target table.

While doing this operation, there could be failure at step2 or step3. 
Observing the behaviour that, if there are any anomalies or incorrect format in the input file or target table, entire MERGE INTOCREATE TABLE [USING] command fails.
Is there a way capture the reason for failure at record level ? Tried supplying the argument badRecordsPath as mentioned in the documentation didn't find any error files being created.

Is it safe to assume all records gets into the temp table via the CREATE TABLE command, or none if there are any anomalies with a single record? It's not partial, correct? Same for the MERGE_INTO command—it's not partial, request to confirm.

1 REPLY 1

Rishabh_Tiwari
Databricks Employee
Databricks Employee

Hi @inagar ,

Thank you for reaching out to our community! We're here to help you. 

To ensure we provide you with the best support, could you please take a moment to review the response and choose the one that best answers your question? Your feedback not only helps us assist you better but also benefits other community members who may have similar questions in the future.

If you found the answer helpful, consider giving it a kudo. If the response fully addresses your question, please mark it as the accepted solution. This will help us close the thread and ensure your question is resolved.

We appreciate your participation and are here to assist you further if you need it!

Thanks,

Rishabh

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