beliefer commented on a change in pull request #33341:
URL: https://github.com/apache/spark/pull/33341#discussion_r670986772
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DataFrameTimeWindowingSuite.scala
##########
@@ -17,184 +17,249 @@
package org.apache.spark.sql
-import org.apache.spark.sql.catalyst.plans.logical.Expand
+import java.time.LocalDateTime
+
+import org.apache.spark.sql.catalyst.expressions.AttributeReference
+import org.apache.spark.sql.catalyst.plans.logical.{Aggregate, Expand}
import org.apache.spark.sql.functions._
import org.apache.spark.sql.test.SharedSparkSession
-import org.apache.spark.sql.types.StringType
+import org.apache.spark.sql.types._
class DataFrameTimeWindowingSuite extends QueryTest with SharedSparkSession {
import testImplicits._
test("simple tumbling window with record at window start") {
- val df = Seq(
- ("2016-03-27 19:39:30", 1, "a")).toDF("time", "value", "id")
-
- checkAnswer(
- df.groupBy(window($"time", "10 seconds"))
- .agg(count("*").as("counts"))
- .orderBy($"window.start".asc)
- .select($"window.start".cast("string"), $"window.end".cast("string"),
$"counts"),
- Seq(
- Row("2016-03-27 19:39:30", "2016-03-27 19:39:40", 1)
+ val df1 = Seq(("2016-03-27 19:39:30", 1, "a")).toDF("time", "value", "id")
Review comment:
Yes. The string type will implict cast to the old timestamp type first.
--
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]