gengliangwang commented on a change in pull request #33341: URL: https://github.com/apache/spark/pull/33341#discussion_r671132954
########## 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: @cloud-fan from the current Type Coercion rules, when it comes to String and AnyTimestamp, we always cast as `AnyTimestampType.defaultConcreteType`. This is out of the scope of this PR. Let's revisit that later. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org