Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import org.apache.spark.sql.catalyst.util.CharVarcharUtils
import org.apache.spark.sql.catalyst.util.ResolveDefaultColumns.getDefaultValueExprOrNullLit
import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._
import org.apache.spark.sql.errors.QueryCompilationErrors
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types.{DataType, StructType}
import org.apache.spark.util.ArrayImplicits._

Expand Down Expand Up @@ -183,7 +182,7 @@ object AssignmentUtils extends SQLConfHelper with CastSupport {
} else if (exactAssignments.isEmpty && fieldAssignments.isEmpty) {
TableOutputResolver.checkNullability(colExpr, col, conf, colPath)
} else if (exactAssignments.nonEmpty) {
if (SQLConf.get.mergeUpdateStructsByField && updateStar) {
if (updateStar) {
val value = exactAssignments.head.value
col.dataType match {
case structType: StructType =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object ResolveRowLevelCommandAssignments extends Rule[LogicalPlan] {
case m: MergeIntoTable if !m.skipSchemaResolution && m.resolved && m.rewritable && !m.aligned &&
!m.needSchemaEvolution =>
validateStoreAssignmentPolicy()
val coerceNestedTypes = SQLConf.get.mergeCoerceNestedTypes
val coerceNestedTypes = SQLConf.get.coerceMergeNestedTypes
m.copy(
targetTable = cleanAttrMetadata(m.targetTable),
matchedActions = alignActions(m.targetTable.output, m.matchedActions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6704,18 +6704,6 @@ object SQLConf {
.booleanConf
.createWithDefault(true)

val MERGE_INTO_NESTED_TYPE_UPDATE_BY_FIELD =
buildConf("spark.sql.merge.nested.type.assign.by.field")
.internal()
.doc("If enabled and spark.sql.merge.source.nested.type.coercion.enabled is true," +
"allow MERGE INTO with UPDATE SET * action to set nested structs field by field. " +
"In updated rows, target structs will preserve the original value for fields missing " +
"in the the source struct. If disabled, the entire target struct will be replaced, " +
"and fields missing in the source struct will be null.")
.version("4.1.0")
.booleanConf
.createWithDefault(true)

/**
* Holds information about keys that have been deprecated.
*
Expand Down Expand Up @@ -7915,12 +7903,9 @@ class SQLConf extends Serializable with Logging with SqlApiConf {
def legacyXMLParserEnabled: Boolean =
getConf(SQLConf.LEGACY_XML_PARSER_ENABLED)

def mergeCoerceNestedTypes: Boolean =
def coerceMergeNestedTypes: Boolean =
getConf(SQLConf.MERGE_INTO_NESTED_TYPE_COERCION_ENABLED)

def mergeUpdateStructsByField: Boolean =
getConf(SQLConf.MERGE_INTO_NESTED_TYPE_UPDATE_BY_FIELD)

/** ********************** SQLConf functionality methods ************ */

/** Set Spark SQL configuration properties. */
Expand Down
Loading