Skip to content

Commit 3bfc70e

Browse files
fix CloneParquetByPathSuite
1 parent a8ec23d commit 3bfc70e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spark/src/test/scala/org/apache/spark/sql/delta/CloneParquetSuite.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.spark.sql.delta
1818

1919
import org.apache.spark.SparkException
20+
import org.apache.spark.SparkThrowable
2021
import org.apache.spark.sql.DataFrame
2122
import org.apache.spark.sql.functions.col
2223

@@ -49,10 +50,13 @@ class CloneParquetByPathSuite extends CloneParquetSuiteBase
4950
withParquetTable(df, Seq("key1", "key2")) { sourceIdent =>
5051
val tableName = "cloneTable"
5152
withTable(tableName) {
52-
val se = intercept[SparkException] {
53+
val errorMessage = intercept[SparkThrowable] {
5354
sql(s"CREATE TABLE $tableName $mode CLONE $sourceIdent")
55+
} match {
56+
case e: SparkException => e.getMessage // Spark 3.5
57+
case e: DeltaAnalysisException => e.getMessage // Spark 4.0
5458
}
55-
assert(se.getMessage.contains("Expecting 0 partition column(s)"))
59+
assert(errorMessage.contains("Expecting 0 partition column(s)"))
5660
}
5761
}
5862
}

0 commit comments

Comments
 (0)