0

I would like to add a new column to my Pyspark dataframe using a Window function, where the rowsBetween are parametrized by values from columns from the dataframe.

I tried date_window.rowsBetween(-(F.lit(2) + offset), -offset), but Spark tells me ValueError: Cannot convert column into bool: please use '&' for 'and', '|' for 'or', '~' for 'not' when building DataFrame boolean expressions. which I did not expect in this case.

Is there any way to parametrize rowsBetween using values from specific columns?

3yakuya
  • 2,622
  • 4
  • 25
  • 40

0 Answers0