PySpark:转换T-SQL Case时将Then语句转换为PySpark

时间:2018-06-08 14:32:24

标签: sql-server apache-spark filter pyspark case

我希望在用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

0 个答案:

没有答案