Skip to content

Commit a447b08

Browse files
committed
fix tests for SPARK-39469
1 parent ac63b63 commit a447b08

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/csv/UnivocityParserSuite.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ class UnivocityParserSuite extends SparkFunSuite with SQLHelper {
377377
def checkDate(dataType: DataType): Unit = {
378378
val timestampsOptions =
379379
new CSVOptions(Map("inferDate" -> "true", "timestampFormat" -> "dd/MM/yyyy HH:mm",
380-
"timestampNTZFormat" -> "dd-MM-yyyy HH:mm", "dateFormat" -> "dd_MM_yyyy"),
380+
"timestampNTZFormat" -> "dd-MM-yyyy HH:mm", "dateFormat" -> "dd_MM_yyyy",
381+
// Required for date string to be parsed as timestamp since it misses the time component
382+
"enableDateTimeParsingFallback" -> "true"),
381383
false, DateTimeUtils.getZoneId("-08:00").toString)
382384
// Use CSVOption ZoneId="-08:00" (PST) to test that Dates in TimestampNTZ column are always
383385
// converted to their equivalent UTC timestamp

sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,6 +2797,7 @@ abstract class CSVSuite
27972797
"inferSchema" -> "true",
27982798
"timestampFormat" -> "yyyy-MM-dd'T'HH:mm:ss",
27992799
"dateFormat" -> "yyyy-MM-dd",
2800+
"enableDateTimeParsingFallback" -> "true",
28002801
"inferDate" -> "true")
28012802
val options2 = Map(
28022803
"header" -> "true",

0 commit comments

Comments
 (0)