Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/7057#discussion_r34599594
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveDataFrameWindowSuite.scala
---
@@ -189,7 +189,7 @@ class HiveDataFrameWindowSuite extends QueryTest {
df.select(
$"key",
last("value").over(
- Window.partitionBy($"value").orderBy($"key").rangeBetween(1,
Long.MaxValue))
+ Window.partitionBy($"value").orderBy($"key").rangeBetween(-1, 0))
--- End diff --
I think the test dataset is not a useful one. How about we change it
`val df = Seq((5, "1"), (5, "2"), (4, "2"), (6, "2"), (3, "1"), (2,
"2")).toDF("key", "value1")` and for the last_value's frame, we use
`rangeBetween(-2, -1)`? Although `last_value` is not a deterministic function
in general, if we apply it on the order by expression, the result will be
deterministic.
---
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]