Github user gatorsmile commented on the issue:
https://github.com/apache/spark/pull/17432
Thank you! uh, I have another case with different data types. That is why I
did not correctly reproduce it. The project is not removed due to data type
mismatches. : )
```Scala
val df = Seq((1, 2, "2"), (1, 2, "3"), (1, 2, "1"), (1, 2, "-2"), (1,
2, "-1"))
.toDF("key", "key1", "value")
val specs =
Window.partitionBy($"key").orderBy($"key1").rowsBetween(Window.unboundedPreceding,
0)
val df1 = df.withColumn("res", sum("value").over(specs))
val df2 = df1.withColumn("avg_value", max("value").over(specs))
df2.explain(true)
```
```
== Optimized Logical Plan ==
Window [max(value#9) windowspecdefinition(key#7, key1#8 ASC NULLS FIRST,
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS avg_value#23], [key#7],
[key1#8 ASC NULLS FIRST]
+- Project [key#7, key1#8, value#9, res#15]
+- Window [sum(_w0#16) windowspecdefinition(key#7, key1#8 ASC NULLS
FIRST, ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS res#15], [key#7],
[key1#8 ASC NULLS FIRST]
+- LocalRelation [key#7, key1#8, value#9, _w0#16]
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]