Предложение where
здесь не работает из-за orderBy
. Есть ли обходной путь к этому?
new_subs_df = new_subs_df.withColumn(
'last_x_date',
lag(col("x_date").over(
Window.partitionBy('user_id')\
.orderBy(
to_date(col('z_date'),None).asc(),
to_date(col('y_date'),None).asc()
)\
.where(col('event_type') != '1')
)
)