嗨,我正在尝试火花窗口功能。我需要从“0”开始row_number。这是我的代码。
val target2 = target1.select("id","name","mark1","mark2","version").withColumn("rank", row_number().over(Window.partitionBy("name","mark1","mark2").orderBy("id")))
行号从“1”开始。我试过这样的。
val target2 = target1.select("id","name","mark1","mark2","version").withColumn("rank", row_number().over(Window.partitionBy("name","mark1","mark2").orderBy("id") -1))
val target2 = target1.select("id","name","mark1","mark2","version").withColumn("rank", row_number().over(Window.partitionBy("name","mark1","mark2").orderBy("id"))) -1
不适合我。我需要从零开始我的row_number。任何帮助将不胜感激。