Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. from pyspark.sql.functions import *
  2.  
  3. # Example 1
  4. fact_df = fact_df.withColumn('colname', trim(col('colname'))).alias('fact_df')
  5.  
  6. # Example 2
  7. fact_df = fact_df.join(dimension_df, trim(col('fact_df.colname') == trim(col('dimension_df.another_colname')), 'left').alias('fact_df')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement