Skip to content

Commit

Permalink
Migrate CSVHeaderChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed Feb 10, 2024
1 parent 7ceeacf commit 6edfda6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions common/utils/src/main/resources/error/error-classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -7720,6 +7720,11 @@
"Failed to parse a value for data type <dt> with event <e>"
]
},
"_LEGACY_ERROR_TEMP_3241" : {
"message" : [
"<msg>"
]
},
"_LEGACY_ERROR_USER_RAISED_EXCEPTION" : {
"message" : [
"<errorMessage>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.apache.spark.sql.catalyst.csv

import com.univocity.parsers.csv.CsvParser

import org.apache.spark.SparkIllegalArgumentException
import org.apache.spark.internal.Logging
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types.StructType
Expand Down Expand Up @@ -92,7 +93,9 @@ class CSVHeaderChecker(
if (enforceSchema) {
logWarning(msg)
} else {
throw new IllegalArgumentException(msg)
throw new SparkIllegalArgumentException(
errorClass = "_LEGACY_ERROR_TEMP_3241",
messageParameters = Map("msg" -> msg))
}
}
}
Expand Down

0 comments on commit 6edfda6

Please sign in to comment.