spark sql加载csv文件并筛选

spark sql加载csv文件并筛选

from pyspark.sql.types import TimestampType
import pandas as pd
pd_df = pd.read_csv('/home/product_with_decd.csv')
DF = spark.createDataFrame(pd_df)
#增加一列
DF = DF.withColumn('before_after_flg',DF.last_etl_acg_dt<DF.purchase_date)

你可能感兴趣的:(spark)