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

[GLUTEN-5341] Fix and enable delta UTs for Spark3.5 #5393

Merged
merged 1 commit into from
Apr 15, 2024
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 @@ -52,7 +52,11 @@ case class DeltaScanTransformer(
override lazy val fileFormat: ReadFileFormat = ReadFileFormat.ParquetReadFormat

override protected def doValidateInternal(): ValidationResult = {
if (requiredSchema.fields.exists(_.name == "__delta_internal_is_row_deleted")) {
if (
requiredSchema.fields.exists(
_.name == "__delta_internal_is_row_deleted") || requiredSchema.fields.exists(
_.name == "__delta_internal_row_index")
) {
return ValidationResult.notOk(s"Deletion vector is not supported in native.")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class VeloxDeltaSuite extends WholeStageTransformerSuite {
}

// IdMapping is supported in Delta 2.2 (related to Spark3.3.1)
// Disable for Spark3.5.
testWithSpecifiedSparkVersion("column mapping mode = id", Some("3.3"), Some("3.4")) {
testWithSpecifiedSparkVersion("column mapping mode = id", Some("3.3")) {
withTable("delta_cm1") {
spark.sql(s"""
|create table delta_cm1 (id int, name string) using delta
Expand All @@ -63,8 +62,7 @@ class VeloxDeltaSuite extends WholeStageTransformerSuite {
}

// NameMapping is supported in Delta 2.0 (related to Spark3.2.0)
// Disable for Spark3.5.
testWithSpecifiedSparkVersion("column mapping mode = name", Some("3.2"), Some("3.4")) {
testWithSpecifiedSparkVersion("column mapping mode = name", Some("3.2")) {
withTable("delta_cm2") {
spark.sql(s"""
|create table delta_cm2 (id int, name string) using delta
Expand All @@ -83,8 +81,7 @@ class VeloxDeltaSuite extends WholeStageTransformerSuite {
}
}

// Disable for Spark3.5.
testWithSpecifiedSparkVersion("delta: time travel", Some("3.3"), Some("3.4")) {
testWithSpecifiedSparkVersion("delta: time travel", Some("3.3")) {
withTable("delta_tm") {
spark.sql(s"""
|create table delta_tm (id int, name string) using delta
Expand All @@ -109,8 +106,7 @@ class VeloxDeltaSuite extends WholeStageTransformerSuite {
}
}

// Disable for Spark3.5.
testWithSpecifiedSparkVersion("delta: partition filters", Some("3.2"), Some("3.4")) {
testWithSpecifiedSparkVersion("delta: partition filters", Some("3.2")) {
withTable("delta_pf") {
spark.sql(s"""
|create table delta_pf (id int, name string) using delta partitioned by (name)
Expand All @@ -129,11 +125,7 @@ class VeloxDeltaSuite extends WholeStageTransformerSuite {
}
}

// Disable for Spark3.5.
testWithSpecifiedSparkVersion(
"basic test with stats.skipping disabled",
Some("3.2"),
Some("3.4")) {
testWithSpecifiedSparkVersion("basic test with stats.skipping disabled", Some("3.2")) {
withTable("delta_test2") {
withSQLConf("spark.databricks.delta.stats.skipping" -> "false") {
spark.sql(s"""
Expand All @@ -153,8 +145,7 @@ class VeloxDeltaSuite extends WholeStageTransformerSuite {
}
}

// Disable for Spark3.5.
testWithSpecifiedSparkVersion("column mapping with complex type", Some("3.2"), Some("3.4")) {
testWithSpecifiedSparkVersion("column mapping with complex type", Some("3.2")) {
withTable("t1") {
val simpleNestedSchema = new StructType()
.add("a", StringType, true)
Expand Down Expand Up @@ -204,8 +195,7 @@ class VeloxDeltaSuite extends WholeStageTransformerSuite {
}
}

// Disable for Spark3.5
testWithSpecifiedSparkVersion("deletion vector", Some("3.4"), Some("3.4")) {
testWithSpecifiedSparkVersion("deletion vector", Some("3.4")) {
withTempPath {
p =>
import testImplicits._
Expand Down
Loading