aokolnychyi commented on code in PR #52504:
URL: https://github.com/apache/spark/pull/52504#discussion_r2414525715
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala:
##########
@@ -3881,6 +3870,60 @@ class DataSourceV2SQLSuiteV1Filter
}
}
+ test("test default value special column name conflicting with real column
name") {
+ val t = "testcat.ns.t"
+ withTable("t") {
+ sql(s"""CREATE table $t (
+ c1 STRING,
+ current_date DATE DEFAULT CURRENT_DATE,
+ current_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ current_time time DEFAULT CURRENT_TIME,
+ current_user STRING DEFAULT CURRENT_USER,
+ session_user STRING DEFAULT SESSION_USER,
+ user STRING DEFAULT USER,
+ current_database STRING DEFAULT CURRENT_DATABASE(),
+ current_catalog STRING DEFAULT CURRENT_CATALOG())""")
+ sql(s"INSERT INTO $t (c1) VALUES ('a')")
+ val result = sql(s"SELECT * FROM $t").collect()
+ assert(result.length == 1)
Review Comment:
I feel like this test ensures that there is no exception but it doesn't
validate that we actually use functions. Can we capture the executed plan in
CREATE and validate that the plan uses functions, not attributes?
--
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]