Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
itholic committed Oct 17, 2024
1 parent ab114c9 commit 2a09347
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ class CsvExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper with P
}

test("verify corrupt column") {
checkExceptionInExpression[AnalysisException](
checkErrorInExpression[AnalysisException](
CsvToStructs(
schema = StructType.fromDDL("i int, _unparsed boolean"),
options = Map("columnNameOfCorruptRecord" -> "_unparsed"),
child = Literal.create("a"),
timeZoneId = UTC_OPT),
expectedErrMsg = "The field for corrupt records must be string type and nullable")
timeZoneId = UTC_OPT), null, "INVALID_CORRUPT_RECORD_TYPE",
Map("columnName" -> "`_unparsed`", "actualType" -> "\"BOOLEAN\""))
}

test("from/to csv with intervals") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,13 +791,13 @@ class JsonExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper with
}

test("verify corrupt column") {
checkExceptionInExpression[AnalysisException](
checkErrorInExpression[AnalysisException](
JsonToStructs(
schema = StructType.fromDDL("i int, _unparsed boolean"),
options = Map("columnNameOfCorruptRecord" -> "_unparsed"),
child = Literal.create("""{"i":"a"}"""),
timeZoneId = UTC_OPT),
expectedErrMsg = "The field for corrupt records must be string type and nullable")
timeZoneId = UTC_OPT), null, "INVALID_CORRUPT_RECORD_TYPE",
Map("columnName" -> "`_unparsed`", "actualType" -> "\"BOOLEAN\""))
}

def decimalInput(langTag: String): (Decimal, String) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,13 @@ class XmlExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper with P
}

test("verify corrupt column") {
checkExceptionInExpression[AnalysisException](
XmlToStructs(
checkErrorInExpression[AnalysisException](
JsonToStructs(
schema = StructType.fromDDL("i int, _unparsed boolean"),
options = Map("columnNameOfCorruptRecord" -> "_unparsed"),
child = Literal.create("""{"i":"a"}"""),
timeZoneId = UTC_OPT),
expectedErrMsg = "The field for corrupt records must be string type and nullable")
timeZoneId = UTC_OPT), null, "INVALID_CORRUPT_RECORD_TYPE",
Map("columnName" -> "`_unparsed`", "actualType" -> "\"BOOLEAN\""))
}

def decimalInput(langTag: String): (Decimal, String) = {
Expand Down

0 comments on commit 2a09347

Please sign in to comment.