gengliangwang commented on code in PR #36091:
URL: https://github.com/apache/spark/pull/36091#discussion_r847573842
##########
sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala:
##########
@@ -1255,6 +1255,173 @@ class InsertSuite extends DataSourceTest with
SharedSparkSession {
}
}
+ test("SPARK-38811 INSERT INTO on columns added with ALTER TABLE ADD COLUMNS:
Positive tests") {
+ // There is a complex expression in the default value.
+ withTable("t") {
+ sql("create table t(i boolean) using parquet")
+ sql("alter table t add column s string default concat('abc', 'def')")
+ sql("insert into t values(true, default)")
+ checkAnswer(sql("select s from t where i = true"), Seq("abcdef").map(i
=> Row(i)))
Review Comment:
```suggestion
checkAnswer(sql("select s from t where i = true"), Row("abcdef"))
```
--
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]