comphead commented on code in PR #3876:
URL: https://github.com/apache/datafusion-comet/pull/3876#discussion_r3030545851
##########
spark/src/test/scala/org/apache/comet/exec/CometWindowExecSuite.scala:
##########
@@ -605,87 +606,131 @@ class CometWindowExecSuite extends CometTestBase {
}
}
- // TODO: LAG produces incorrect results
- ignore("window: LAG with default offset") {
- withTempDir { dir =>
- (0 until 30)
- .map(i => (i % 3, i % 5, i))
- .toDF("a", "b", "c")
- .repartition(3)
- .write
- .mode("overwrite")
- .parquet(dir.toString)
-
- spark.read.parquet(dir.toString).createOrReplaceTempView("window_test")
- val df = sql("""
- SELECT a, b, c,
- LAG(c) OVER (PARTITION BY a ORDER BY b) as lag_c
- FROM window_test
- """)
- checkSparkAnswerAndOperator(df)
+ test("window: LAG with default offset") {
+
withSQLConf(CometConf.getOperatorAllowIncompatConfigKey(classOf[WindowExec]) ->
"true") {
+ withTempDir { dir =>
+ (0 until 30)
+ .map(i => (i % 3, i % 5, i))
+ .toDF("a", "b", "c")
+ .repartition(3)
+ .write
+ .mode("overwrite")
+ .parquet(dir.toString)
+
+ spark.read.parquet(dir.toString).createOrReplaceTempView("window_test")
+ val df = sql("""
+ SELECT a, b, c,
+ LAG(c) OVER (PARTITION BY a ORDER BY b, c) as lag_c
+ FROM window_test
+ """)
+ checkSparkAnswerAndOperator(df)
+ }
}
}
- // TODO: LAG with offset 2 produces incorrect results
- ignore("window: LAG with offset 2 and default value") {
- withTempDir { dir =>
- (0 until 30)
- .map(i => (i % 3, i % 5, i))
- .toDF("a", "b", "c")
- .repartition(3)
- .write
- .mode("overwrite")
- .parquet(dir.toString)
-
- spark.read.parquet(dir.toString).createOrReplaceTempView("window_test")
- val df = sql("""
- SELECT a, b, c,
- LAG(c, 2, -1) OVER (PARTITION BY a ORDER BY b) as lag_c_2
- FROM window_test
- """)
- checkSparkAnswerAndOperator(df)
+ test("window: LAG with offset 2 and default value") {
Review Comment:
oh nice, the PR also fixes this test although it is not related to `IGNORE
NULLS`
--
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]