Skip to content

Commit 65f222e

Browse files
committed
Avoid unnecessary changes in DateTimeUtilsSuite
1 parent 2dc5be4 commit 65f222e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper {
3838

3939
test("nanoseconds truncation") {
4040
val tf = TimestampFormatter.getFractionFormatter(DateTimeUtils.defaultTimeZone.toZoneId)
41-
4241
def checkStringToTimestamp(originalTime: String, expectedParsedTime: String): Unit = {
4342
val parsedTimestampOp = DateTimeUtils.stringToTimestamp(
4443
UTF8String.fromString(originalTime), defaultZoneId)
@@ -456,7 +455,6 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper {
456455
assert(toJavaTimestamp(fromUTCTime(fromJavaTimestamp(Timestamp.valueOf(utc)), tz)).toString
457456
=== expected)
458457
}
459-
460458
for (tz <- ALL_TIMEZONES) {
461459
withDefaultTimeZone(tz) {
462460
test("2011-12-25 09:00:00.123456", "UTC", "2011-12-25 09:00:00.123456")
@@ -512,10 +510,10 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper {
512510

513511
test("truncTimestamp") {
514512
def testTrunc(
515-
level: Int,
516-
expected: String,
517-
inputTS: SQLTimestamp,
518-
zoneId: ZoneId = defaultZoneId): Unit = {
513+
level: Int,
514+
expected: String,
515+
inputTS: SQLTimestamp,
516+
zoneId: ZoneId = defaultZoneId): Unit = {
519517
val truncated =
520518
DateTimeUtils.truncTimestamp(inputTS, level, zoneId)
521519
val expectedTS = toTimestamp(expected, defaultZoneId)
@@ -701,7 +699,6 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper {
701699
val millisLocal = millisUtc + timeZone.getOffset(millisUtc)
702700
Math.floor(millisLocal.toDouble / MILLIS_PER_DAY).toInt
703701
}
704-
705702
private def fromJavaDateLegacy(date: Date): Int = {
706703
millisToDaysLegacy(date.getTime, defaultTimeZone())
707704
}

0 commit comments

Comments
 (0)