cloud-fan commented on code in PR #43385:
URL: https://github.com/apache/spark/pull/43385#discussion_r1363837920
##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala:
##########
@@ -1521,4 +1521,119 @@ class DataFrameWindowFunctionsSuite extends QueryTest
assert(windows.size === 1)
}
}
+
+ test("SPARK-45543: WindowGroupLimit causes bug if window expressions exists
non-rank function") {
+ val df = Seq(
+ (1, "Dave", 1, 2020),
+ (2, "Dave", 1, 2021),
+ (3, "Dave", 2, 2022),
+ (4, "Dave", 3, 2023),
+ (5, "Dave", 3, 2024),
+ (6, "Mark", 2, 2022),
+ (7, "Mark", 3, 2023),
+ (8, "Mark", 3, 2024),
+ (9, "Amy", 6, 2021),
+ (10, "Amy", 5, 2022),
+ (11, "Amy", 6, 2023),
+ (12, "Amy", 7, 2024),
+ (13, "John", 7, 2024)).toDF("id", "name", "score", "year")
+
+ val window = Window.partitionBy($"year").orderBy($"score".desc)
+ val window2 = window.rowsBetween(Window.unboundedPreceding,
Window.currentRow)
+ val window3 = window.rowsBetween(Window.unboundedPreceding,
Window.unboundedFollowing)
+
+ Seq(true, false).foreach { enableEvaluator =>
+ withSQLConf(SQLConf.USE_PARTITION_EVALUATOR.key ->
enableEvaluator.toString) {
Review Comment:
no need to test it. just test with the default
##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala:
##########
@@ -1521,4 +1521,119 @@ class DataFrameWindowFunctionsSuite extends QueryTest
assert(windows.size === 1)
}
}
+
+ test("SPARK-45543: WindowGroupLimit causes bug if window expressions exists
non-rank function") {
+ val df = Seq(
+ (1, "Dave", 1, 2020),
+ (2, "Dave", 1, 2021),
+ (3, "Dave", 2, 2022),
+ (4, "Dave", 3, 2023),
+ (5, "Dave", 3, 2024),
+ (6, "Mark", 2, 2022),
+ (7, "Mark", 3, 2023),
+ (8, "Mark", 3, 2024),
+ (9, "Amy", 6, 2021),
+ (10, "Amy", 5, 2022),
+ (11, "Amy", 6, 2023),
+ (12, "Amy", 7, 2024),
+ (13, "John", 7, 2024)).toDF("id", "name", "score", "year")
+
+ val window = Window.partitionBy($"year").orderBy($"score".desc)
+ val window2 = window.rowsBetween(Window.unboundedPreceding,
Window.currentRow)
+ val window3 = window.rowsBetween(Window.unboundedPreceding,
Window.unboundedFollowing)
+
+ Seq(true, false).foreach { enableEvaluator =>
+ withSQLConf(SQLConf.USE_PARTITION_EVALUATOR.key ->
enableEvaluator.toString) {
Review Comment:
no need to test it twice. just test with the default
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]