Created
December 27, 2021 12:28
-
-
Save 1ambda/f9cbb9380528fe396c93129f48418458 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dfListingSales = dfListingMeta\ | |
.select( | |
col("id").alias("listing_id"), | |
col("name").alias("listing_name"))\ | |
.alias("LISTING_META")\ | |
.join( | |
other = dfListingCalendarSales.alias("LISTING_SALES"), | |
on = col("LISTING_META.listing_id") == col("LISTING_SALES.listing_id"), | |
how = "left" | |
)\ | |
.select( | |
col("LISTING_META.listing_id"), | |
col("LISTING_META.listing_name"), | |
coalesce(col("LISTING_SALES.price_order"), lit(0)).alias("price_order"), | |
coalesce(col("LISTING_SALES.count_order"), lit(0)).alias("count_order"), | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment