a guest Feb 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from pyspark.sql.functions import *
- # Example 1
- fact_df = fact_df.withColumn('colname', trim(col('colname'))).alias('fact_df')
- # Example 2
- fact_df = fact_df.join(dimension_df, trim(col('fact_df.colname') == trim(col('dimension_df.another_colname')), 'left').alias('fact_df')
RAW Paste Data