Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed Dec 16, 2018
1 parent ba4a9dc commit beb6912
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.apache.spark.sql.catalyst.csv

import java.text.ParsePosition

import scala.util.control.Exception.allCatch

import org.apache.spark.rdd.RDD
Expand All @@ -30,14 +28,13 @@ import org.apache.spark.sql.types._
class CSVInferSchema(val options: CSVOptions) extends Serializable {

@transient
private lazy val timestampParser = TimestampFormatter(
private lazy val timestampFormatter = TimestampFormatter(
options.timestampFormat,
options.timeZone,
options.locale)
@transient
private lazy val dateFormatter = DateFormatter(
options.dateFormat,
options.timeZone,
options.locale)

private val decimalParser = {
Expand Down Expand Up @@ -167,7 +164,7 @@ class CSVInferSchema(val options: CSVOptions) extends Serializable {
}

private def tryParseTimestamp(field: String): DataType = {
if ((allCatch opt timestampParser.parse(field)).isDefined) {
if ((allCatch opt timestampFormatter.parse(field)).isDefined) {
TimestampType
} else {
tryParseDate(field)
Expand Down

0 comments on commit beb6912

Please sign in to comment.