'Converting PL/SQL procedures to Pyspark

BEGIN
   open v_refcur for
       SELECT A.LGCY_LNDR_NO
            , A.LGCY_LNDR_BR_NO
            , A.LNDR_NM
            , B.ADDR_LINE1_TXT
            , B.ADDR_LINE2_TXT
            , B.CITY_NM
            , B.ST_CD
            , B.POSTAL_CD
            , C.FAX_NO
        FROM LNDR_CUST_XREF A
        LEFT OUTER JOIN LNDR_CUST_ADDR B
        ON A.LNDR_ID = B.LNDR_ID
        AND B.ADDR_TYP_CD = 'MAIL'
        LEFT OUTER JOIN LNDR_CUST_ADDR C
        ON A.LNDR_ID = C.LNDR_ID
        AND C.ADDR_TYP_CD = 'SITE'
        WHERE A.LGCY_LNDR_NO = LNDR_NO
        AND A.LGCY_LNDR_BR_NO = BRN_NO
        AND A.TA_CUST_FLG = 'Y';
   SQL_CD := SWV_SQLCODE;
END;

What will be the line by line conversion of this above code? I dont have the databases in-hand, so what would be the most appropriate gist of the PL/SQL code in Pyspark?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source