Skip to content

Instantly share code, notes, and snippets.

@1ambda
Created December 27, 2021 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1ambda/b64847aef733c96dc0c587b51cc4fa1c to your computer and use it in GitHub Desktop.
Save 1ambda/b64847aef733c96dc0c587b51cc4fa1c to your computer and use it in GitHub Desktop.
dfSalesDec = dfCalendarSalesDec.alias("CALENDAR_META")\
.join(
dfCalendarSalesDec.alias("CALENDAR_SALES"),
col("CALENDAR_META.date") == col("CALENDAR_SALES.date"),
"left"
)\
.select(col("CALENDAR_META.date"), coalesce(col("CALENDAR_SALES.count_uniq_listing"), lit(0)).alias("count_uniq_listing"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment