我希望在用T-SQL写入Pyspark的语句时复制我的案例。但我对Pyspark来说是全新的。
SELECT Table1.Part
, Table1.Serial
, Table1.AIRCRAFT_NUMBER
, Table1.date_removed
, Table2.dbo.E15.TIME
, Table2.dbo.E15.TSO
, data.dbo.EE18.Allowable_Time
, CASE
WHEN (data.dbo.EE18.Allowable_Time > 0)
THEN data.dbo.EE18.Allowable_Time - Table2.dbo.E15.TSO
END AS CAL
FROM Table1 t1