File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
spark/src/test/scala/org/apache/spark/sql/delta Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 17
17
package org .apache .spark .sql .delta
18
18
19
19
import org .apache .spark .SparkException
20
+ import org .apache .spark .SparkThrowable
20
21
import org .apache .spark .sql .DataFrame
21
22
import org .apache .spark .sql .functions .col
22
23
@@ -49,10 +50,13 @@ class CloneParquetByPathSuite extends CloneParquetSuiteBase
49
50
withParquetTable(df, Seq (" key1" , " key2" )) { sourceIdent =>
50
51
val tableName = " cloneTable"
51
52
withTable(tableName) {
52
- val se = intercept[SparkException ] {
53
+ val errorMessage = intercept[SparkThrowable ] {
53
54
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
54
58
}
55
- assert(se.getMessage .contains(" Expecting 0 partition column(s)" ))
59
+ assert(errorMessage .contains(" Expecting 0 partition column(s)" ))
56
60
}
57
61
}
58
62
}
You can’t perform that action at this time.
0 commit comments