Skip to content

Commit da8c4e0

Browse files
dongjoon-hyunvinodkc
authored andcommitted
[SPARK-28201][SQL][TEST][FOLLOWUP] Fix Integration test suite according to the new exception message
## What changes were proposed in this pull request? apache#25010 breaks the integration test suite due to the changing the user-facing exception like the following. This PR fixes the integration test suite. ```scala - require( - decimalVal.precision <= precision, - s"Decimal precision ${decimalVal.precision} exceeds max precision $precision") + if (decimalVal.precision > precision) { + throw new ArithmeticException( + s"Decimal precision ${decimalVal.precision} exceeds max precision $precision") + } ``` ## How was this patch tested? Manual test. ``` $ build/mvn install -DskipTests $ build/mvn -Pdocker-integration-tests -pl :spark-docker-integration-tests_2.12 test ``` Closes apache#25165 from dongjoon-hyun/SPARK-28201. Authored-by: Dongjoon Hyun <dhyun@apple.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
1 parent 671fe59 commit da8c4e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/OracleIntegrationSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationSuite with SharedSQLCo
376376
val e = intercept[org.apache.spark.SparkException] {
377377
spark.read.jdbc(jdbcUrl, "tableWithCustomSchema", new Properties()).collect()
378378
}
379-
assert(e.getMessage.contains(
380-
"requirement failed: Decimal precision 39 exceeds max precision 38"))
379+
assert(e.getCause().isInstanceOf[ArithmeticException])
380+
assert(e.getMessage.contains("Decimal precision 39 exceeds max precision 38"))
381381

382382
// custom schema can read data
383383
val props = new Properties()

0 commit comments

Comments
 (0)