Skip to content

Commit

Permalink
[Spark] Fix overflow in GeneratedColumnSuite (delta-io#3652)
Browse files Browse the repository at this point in the history
## Description
Small test fix, follow up from
delta-io#3601
The test contains an overflow and fails when running with ANSI_MODE
enabled.

## How was this patch tested?
Test-only
  • Loading branch information
johanl-db authored Sep 9, 2024
1 parent 15da4aa commit 92f2068
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@ trait GeneratedColumnSuiteBase

test("changing the type of nested field not referenced by a generated col") {
withTableName("disallow_column_type_evolution") { table =>
createTable(table, None, "t STRUCT<a: SMALLINT, b: SMALLINT>, gen SMALLINT",
Map("gen" -> "CAST(HASH(t.a - 10s) AS SMALLINT)"), Nil)
createTable(table, None, "t STRUCT<a: SMALLINT, b: SMALLINT>, gen INT",
Map("gen" -> "HASH(t.a)"), Nil)

// changing the type of `t.b` should succeed since it is not being
// referenced by any CHECK constraints or generated columns.
Expand All @@ -798,7 +798,7 @@ trait GeneratedColumnSuiteBase
.write.format("delta").mode("append")
.option("mergeSchema", "true")
.saveAsTable(table)
checkAnswer(spark.table(table), Row(Row(32767, 32767), -22677) :: Nil)
checkAnswer(spark.table(table), Row(Row(32767, 32767), 1249274084) :: Nil)
}
}

Expand Down

0 comments on commit 92f2068

Please sign in to comment.