Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spark] Disable implicit casting in Delta streaming sink #3691

Merged
Merged
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 @@ -1561,7 +1561,9 @@ trait DeltaSQLConfBase {
|The casting behavior is governed by 'spark.sql.storeAssignmentPolicy'.
|""".stripMargin)
.booleanConf
.createWithDefault(true)
// This feature doesn't properly support structs with missing fields and is disabled until a
// fix is implemented.
.createWithDefault(false)

val DELTA_CDF_UNSAFE_BATCH_READ_ON_INCOMPATIBLE_SCHEMA_CHANGES =
buildConf("changeDataFeed.unsafeBatchReadOnIncompatibleSchemaChanges.enabled")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package org.apache.spark.sql.delta

import org.apache.spark.sql.delta.sources.DeltaSQLConf

import org.apache.spark.sql.SaveMode
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types._

/**
Expand All @@ -32,6 +32,12 @@ import org.apache.spark.sql.types._
*/
class DeltaInsertIntoImplicitCastSuite extends DeltaInsertIntoTest {

override def beforeAll(): Unit = {
super.beforeAll()
spark.conf.set(DeltaSQLConf.DELTA_STREAMING_SINK_ALLOW_IMPLICIT_CASTS.key, "true")
spark.conf.set(SQLConf.ANSI_ENABLED.key, "true")
}

for (schemaEvolution <- BOOLEAN_DOMAIN) {
testInserts("insert with implicit up and down cast on top-level fields, " +
s"schemaEvolution=$schemaEvolution")(
Expand Down
Loading