Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20140#discussion_r166270325
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVInferSchema.scala
---
@@ -90,7 +90,10 @@ private[csv] object CSVInferSchema {
// DecimalTypes have different precisions and scales, so we try
to find the common type.
findTightestCommonType(typeSoFar, tryParseDecimal(field,
options)).getOrElse(StringType)
case DoubleType => tryParseDouble(field, options)
- case TimestampType => tryParseTimestamp(field, options)
+ case DateType => tryParseDate(field, options)
+ case TimestampType =>
+ findTightestCommonType(typeSoFar, tryParseTimestamp(field,
options)).getOrElse(
--- End diff --
I mean, it wasn't clear why we need `findTightestCommonType`. I thought
`case TimestampType => tryParseTimestamp(field, options)` will work.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]