easy5 pts · first answer countssparkspark-window-functions
Comparing with the previous day's sales
You want each row of daily store sales to also show the sales of the previous day for the same store. Which expression does this?
w = Window.partitionBy("store").orderBy("day")
df.withColumn("prev_sales", ???)Discussion 0
Join free to post in the discussion.
Related questions
- When Spark actually runsData Engineer
- What a Spark partition isData Engineer
- What the Spark driver doesData Engineer
- Calling collect() on 500 GBData Engineer
- Why DataFrames beat RDDs of objectsData Engineer
- Entry point of a Spark 3+ appData Engineer
- Tasks in a 64-partition stageData Engineer
- Where a job splits into stagesData Engineer