HeartSaVioR commented on code in PR #38288:
URL: https://github.com/apache/spark/pull/38288#discussion_r1002777786
##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameTimeWindowingSuite.scala:
##########
@@ -575,4 +575,64 @@ class DataFrameTimeWindowingSuite extends QueryTest with
SharedSparkSession {
validateWindowColumnInSchema(schema2, "window")
}
}
+
+ test("window_time function on raw window column") {
+ val df = Seq(
+ ("2016-03-27 19:38:18"), ("2016-03-27 19:39:25")
+ ).toDF("time")
+
+ checkAnswer(
+ df.select(window($"time", "10 seconds").as("window"))
+ .select(
+ $"window.end".cast("string"),
+ window_time($"window").cast("string")
+ ),
+ Seq(
+ Row("2016-03-27 19:38:20", "2016-03-27 19:38:19.999999"),
+ Row("2016-03-27 19:39:30", "2016-03-27 19:39:29.999999")
+ )
+ )
+ }
+
+ test("2 window_time functions on raw window column") {
Review Comment:
Btw, if we want to simply retain the limitation, we should add the check
into unsupported ops checker and provide better error message rather than
unresolved operator, like we do for time window.
--
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]