Skip to content

Commit bbaff09

Browse files
committed
timeParser -> timestampParser
1 parent 0c7b96b commit bbaff09

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/CSVInferSchema.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.apache.spark.sql.types._
2828
class CSVInferSchema(val options: CSVOptions) extends Serializable {
2929

3030
@transient
31-
private lazy val timeParser = TimestampFormatter(
31+
private lazy val timestampParser = TimestampFormatter(
3232
options.timestampFormat,
3333
options.timeZone,
3434
options.locale)
@@ -160,7 +160,7 @@ class CSVInferSchema(val options: CSVOptions) extends Serializable {
160160

161161
private def tryParseTimestamp(field: String): DataType = {
162162
// This case infers a custom `dataFormat` is set.
163-
if ((allCatch opt timeParser.parse(field)).isDefined) {
163+
if ((allCatch opt timestampParser.parse(field)).isDefined) {
164164
TimestampType
165165
} else {
166166
tryParseBoolean(field)

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/UnivocityGenerator.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class UnivocityGenerator(
4141
private val valueConverters: Array[ValueConverter] =
4242
schema.map(_.dataType).map(makeConverter).toArray
4343

44-
private val timeFormatter = TimestampFormatter(
44+
private val timestampFormatter = TimestampFormatter(
4545
options.timestampFormat,
4646
options.timeZone,
4747
options.locale)
@@ -52,7 +52,7 @@ class UnivocityGenerator(
5252
(row: InternalRow, ordinal: Int) => dateFormatter.format(row.getInt(ordinal))
5353

5454
case TimestampType =>
55-
(row: InternalRow, ordinal: Int) => timeFormatter.format(row.getLong(ordinal))
55+
(row: InternalRow, ordinal: Int) => timestampFormatter.format(row.getLong(ordinal))
5656

5757
case udt: UserDefinedType[_] => makeConverter(udt.sqlType)
5858

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/UnivocityParser.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class UnivocityParser(
7474

7575
private val row = new GenericInternalRow(requiredSchema.length)
7676

77-
private val timeFormatter = TimestampFormatter(
77+
private val timestampFormatter = TimestampFormatter(
7878
options.timestampFormat,
7979
options.timeZone,
8080
options.locale)
@@ -158,7 +158,7 @@ class UnivocityParser(
158158
}
159159

160160
case _: TimestampType => (d: String) =>
161-
nullSafeDatum(d, name, nullable, options)(timeFormatter.parse)
161+
nullSafeDatum(d, name, nullable, options)(timestampFormatter.parse)
162162

163163
case _: DateType => (d: String) =>
164164
nullSafeDatum(d, name, nullable, options)(dateFormatter.parse)

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonGenerator.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private[sql] class JacksonGenerator(
7777

7878
private val lineSeparator: String = options.lineSeparatorInWrite
7979

80-
private val timeFormatter = TimestampFormatter(
80+
private val timestampFormatter = TimestampFormatter(
8181
options.timestampFormat,
8282
options.timeZone,
8383
options.locale)
@@ -122,7 +122,7 @@ private[sql] class JacksonGenerator(
122122

123123
case TimestampType =>
124124
(row: SpecializedGetters, ordinal: Int) =>
125-
val timestampString = timeFormatter.format(row.getLong(ordinal))
125+
val timestampString = timestampFormatter.format(row.getLong(ordinal))
126126
gen.writeString(timestampString)
127127

128128
case DateType =>

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class JacksonParser(
5555
private val factory = new JsonFactory()
5656
options.setJacksonOptions(factory)
5757

58-
private val timeFormatter = TimestampFormatter(
58+
private val timestampFormatter = TimestampFormatter(
5959
options.timestampFormat,
6060
options.timeZone,
6161
options.locale)
@@ -224,7 +224,7 @@ class JacksonParser(
224224
case TimestampType =>
225225
(parser: JsonParser) => parseJsonToken[java.lang.Long](parser, dataType) {
226226
case VALUE_STRING if parser.getTextLength >= 1 =>
227-
timeFormatter.parse(parser.getText)
227+
timestampFormatter.parse(parser.getText)
228228

229229
case VALUE_NUMBER_INT =>
230230
parser.getLongValue * 1000000L

0 commit comments

Comments
 (0)