filipniziol
Esteemed Contributor

Hi @pranav_k1 ,

I'm sorry to hear you're having trouble merging data into your table using a temporary view. I'd be happy to help you figure out what's going on.

Could you send the code you are trying to run?

  • Code for Creating the Temporary View
  • Merge Query
  • Table Schemas

Without further details, I can suggest two general reasons that might be causing the issue:

  • Scope of the Temporary View: Temporary views (CREATE TEMP VIEW) are session-scoped. If you're creating the view in one notebook and running the MERGE in another notebook, then the view may no longer exist. In that case you could try creating global temporary view, instead of temporary view (but it is not available in unity catalog)
  • The merge conditions are not matching. Maybe simply in the test data you have a match, but not in the actual data in the temporary view when matched with the actual data in the target table. Check what is the output of the JOIN between your temporary view and target table using the same condition as in MERGE.