Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19559#discussion_r147318994
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala ---
@@ -56,6 +56,24 @@ class DateFunctionsSuite extends QueryTest with
SharedSQLContext {
checkAnswer(sql("""SELECT CURRENT_TIMESTAMP() = NOW()"""), Row(true))
}
+ test("SPARK-22333: timeFunctionCall has conflicts with columnReference
") {
+ val df = Seq((1, 2), (2, 3)).toDF("current_date", "current_timestamp")
+ df.createOrReplaceTempView("ttf")
+ withTempView("ttf") {
+ checkAnswer(sql("SELECT current_date, current_timestamp FROM ttf"),
+ Seq(Row(1, 2), Row(2, 3)))
+ }
+
+ val df1 = Seq((1, 2), (2, 3)).toDF("a", "b")
+ df1.createOrReplaceTempView("ttf1")
+ withTempView("ttf1") {
+ checkAnswer(
+ sql("SELECT current_date = current_date(), current_timestamp =
current_timestamp(), " +
+ "a, b FROM ttf1"),
+ Seq(Row(true, true, 1, 2), Row(true, true, 2, 3)))
+ }
+ }
--- End diff --
Move these to `datetime.sql`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]