Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix sqlState code and typo
  • Loading branch information
Jonathancui123 committed Jul 12, 2022
commit 2484b772efcaa63297d37c95b88c9528f23f55f2
2 changes: 1 addition & 1 deletion core/src/main/resources/error/error-classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"message" : [
"Cannot infer date in schema inference when LegacyTimeParserPolicy is \"LEGACY\". Legacy Date formatter does not support strict date format matching which is required to avoid inferring timestamps and other non-date entries to date."
],
"sqlState" : "22005"
"sqlState" : "22007"
},
"CANNOT_PARSE_DECIMAL" : {
"message" : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.analysis.TypeCoercion
import org.apache.spark.sql.catalyst.expressions.ExprUtils
import org.apache.spark.sql.catalyst.util.{DateFormatter, TimestampFormatter}
import org.apache.spark.sql.catalyst.util.LegacyDateFormats.{FAST_DATE_FORMAT, LENIENT_SIMPLE_DATE_FORMAT}
import org.apache.spark.sql.catalyst.util.LegacyDateFormats.{FAST_DATE_FORMAT}
import org.apache.spark.sql.errors.QueryExecutionErrors
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types._
Expand All @@ -49,7 +49,7 @@ class CSVInferSchema(val options: CSVOptions) extends Serializable {
private lazy val dateFormatter = DateFormatter(
options.dateFormatInRead,
options.locale,
legacyFormat = LENIENT_SIMPLE_DATE_FORMAT,
legacyFormat = FAST_DATE_FORMAT,
isParsing = true)

private val decimalParser = if (options.locale == Locale.US) {
Expand Down