Parametrize window by values in row in Pyspark

给你一囗甜甜゛ 提交于 2021-01-07 02:34:22

问题


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?

来源:https://stackoverflow.com/questions/60931061/parametrize-window-by-values-in-row-in-pyspark

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!