Lets see how to join 2 table with a parameterized on condition in PySpark
Eg: I have 2 dataframes A and B and I want to join them with id,inv_no,item and subitem
onExpr = [(A.id == B.id) &
(A.invc_no == B.invc_no) &
(A.item == B.item) &
(A.subItem == B.subItem)]
(A.item == B.item) &
(A.subItem == B.subItem)]
dailySaleDF = A.join(B, onExpr, 'left').select([c for c in df.columns])