Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/20140#discussion_r162244771 --- 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 -- Mind elaborating why we should find the wider type here?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org