Anonymous
Not applicable

@ELENI GEORGOUSI​ :

  1. Load the data from the two tables into PySpark DataFrames: df1 and df2
  2. Join the two DataFrames on their common columns: call it df
  3. Define a user-defined function (UDF) that implements your IF statement
  4. Add a new column to the DataFrame that computes using the UDF
  5. Insert the data into the target table
  6. Update the source tables:

Hope this helps to give you a framework on how to think and go about curser.