bart-samwel commented on a change in pull request #28996:
URL: https://github.com/apache/spark/pull/28996#discussion_r450166216
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -2656,6 +2656,14 @@ object SQLConf {
.checkValue(_ > 0, "The difference must be positive.")
.createWithDefault(4)
+ val ALLOW_MISSING_COLUMNS_IN_UNION_BY_NAME =
+ buildConf("spark.sql.allowMissingColumnsInUnionByName")
+ .doc("If this config is enabled, `Dataset.unionByName` allows different
set of column names " +
+ "between two Datasets. Missing columns at each side, will be filled with
null values.")
Review comment:
I think there's value in forbidding this behavior by default, because
that might hide logical errors (unioning two totally different schemas). But
this isn't a matter of old/new, and it shouldn't be decided by global configs
-- users would need to set the old or the new behavior *on a case by case
basis*. Why not add a boolean parameter to `unionByName` to allow/disallow,
defaulting to false (disallow)? Or maybe even add this as a separate function
`unionByNameAllowMissing`? (Boolean arguments are not terribly informative to
readers, so I'd actually lean towards having a separate name for this.)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]