dtenedor commented on a change in pull request #35855:
URL: https://github.com/apache/spark/pull/35855#discussion_r832409268



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -2709,6 +2709,28 @@ object SQLConf {
     .booleanConf
     .createWithDefault(false)
 
+  val ENABLE_DEFAULT_COLUMNS =
+    buildConf("spark.sql.parser.enableDefaultColumns")
+      .internal()
+      .doc("When true, allow CREATE TABLE, REPLACE TABLE, and ALTER COLUMN 
statements to set or " +
+        "update default values for specific columns. Following INSERT, MERGE, 
and UPDATE " +
+        "statements may then omit these values and their values will be 
injected automatically " +
+        "instead.")
+      .version("3.3.0")
+      .booleanConf
+      .createWithDefault(true)
+
+  val USE_NULLS_FOR_MISSING_DEFAULT_COLUMN_VALUES =
+    buildConf("spark.sql.parser.useNullsForMissingDefaultColumnValues")
+      .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.3.0")
+      .booleanConf
+      .createWithDefault(false)

Review comment:
       Yeah this PR is already big :) we can leave this disabled by default for 
now, and then consider next whether we want to enable it. Without enabling this 
by default, this new functionality in this PR does not change the results of 
any INSERT INTO statements where the corresponding CREATE/REPLACE TABLE 
commands lack any DEFAULT values (which should be all the cases up until now).




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

Reply via email to