Skip to content
Advertisement

join two rows itertively to create new table in spark with one row for each two rows in new table

Have a table where I want to go in range of two rows

JavaScript

How to I create below table that goes in a range of two and shows the first id with the second col b and message in spark.

Final table will look like this.

JavaScript

Advertisement

Answer

In pyspark you can use Window, example

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement