dtenedor commented on code in PR #36212:
URL: https://github.com/apache/spark/pull/36212#discussion_r854377434
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -2858,15 +2858,15 @@ object SQLConf {
.createWithDefault(true)
val USE_NULLS_FOR_MISSING_DEFAULT_COLUMN_VALUES =
- buildConf("spark.sql.defaultColumn.useNullsForMissingDefautValues")
+ buildConf("spark.sql.defaultColumn.useNullsForMissingDefaultValues")
.internal()
.doc("When true, and DEFAULT columns are enabled, allow column
definitions lacking " +
"explicit default values to behave as if they had specified DEFAULT
NULL instead. " +
"For example, this allows most INSERT INTO statements to specify only
a prefix of the " +
"columns in the target table, and the remaining columns will receive
NULL values.")
.version("3.4.0")
.booleanConf
- .createWithDefault(false)
+ .createWithDefault(true)
Review Comment:
@gengliangwang No problem, per our discussion:
* The previous behavior when inserting fewer values than the number of
columns in the table was to return an error, e.g. `CREATE TABLE t (a INT, b
INT); INSERT INTO t VALUES 42`.
* When updating this `USE_NULLS_FOR_MISSING_DEFAULT_COLUMN_VALUES` config to
true, then such commands would instead succeed and insert NULL values for
remaining columns in the table. This is the behavior that some other engines
use, e.g. Postgres, which some users have requested in Spark.
* This would be a behavior change (which some users may not expect) but not
technically a breaking change because it changes only commands that would have
returned errors to completing successfully instead.

--
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]