Skip to content

Commit 3cdeed7

Browse files
fix ImplicitDMLCastingSuite and DeletionVectorsSuite
1 parent 12fb378 commit 3cdeed7

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

spark/src/main/scala/org/apache/spark/sql/delta/DeltaThrowable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ trait DeltaThrowable extends SparkThrowable {
2525
// Portable error identifier across SQL engines
2626
// If null, error class or SQLSTATE is not set
2727
override def getSqlState: String =
28-
DeltaThrowableHelper.getSqlState(this.getErrorClass.split('.').head)
28+
DeltaThrowableHelper.getSqlState(this.getErrorClass)
2929

3030
// True if this error is an internal error.
3131
override def isInternalError: Boolean = DeltaThrowableHelper.isInternalError(this.getErrorClass)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ class ImplicitDMLCastingSuite extends QueryTest
339339
val expectedDetails =
340340
Seq("DELTA_CAST_OVERFLOW_IN_TABLE_WRITE", sourceValueType, valueColumnName)
341341
for (detail <- expectedDetails) {
342-
assert(userFacingError.toString.contains(detail))
342+
assert(userFacingError.toString.contains(detail) ||
343+
userFacingError.getCause.toString.contains(detail))
343344
}
344345
}
345346
}

spark/src/test/scala/org/apache/spark/sql/delta/deletionvectors/DeletionVectorsSuite.scala

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

1919
import java.io.{File, FileNotFoundException}
20+
import java.net.URISyntaxException
2021

2122
import org.apache.spark.sql.delta.{DeletionVectorsTableFeature, DeletionVectorsTestUtils, DeltaChecksumException, DeltaConfigs, DeltaLog, DeltaMetricsUtils, DeltaTestUtilsForTempViews}
2223
import org.apache.spark.sql.delta.DeltaTestUtils.{createTestAddFile, BOOLEAN_DOMAIN}
@@ -705,7 +706,10 @@ class DeletionVectorsSuite extends QueryTest
705706
val e = intercept[SparkException] {
706707
spark.read.format("delta").load(dir.getCanonicalPath).collect()
707708
}
708-
assert(e.getMessage.contains("URISyntaxException: Malformed escape pair"))
709+
assert(e.getMessage.contains("URISyntaxException: Malformed escape pair") ||
710+
(e.getCause.isInstanceOf[URISyntaxException] &&
711+
e.getCause.getMessage.contains("Malformed escape pair"))
712+
)
709713
}
710714
}
711715

0 commit comments

Comments
 (0)