This is an automated email from the ASF dual-hosted git repository. wenchen pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.0 by this push: new 518cc90 [SPARK-30843][SQL] Fix getting of time components before 1582 year 518cc90 is described below commit 518cc90f434b08c553bc6a23d650decd3449db9d Author: Maxim Gekk <max.g...@gmail.com> AuthorDate: Mon Feb 17 13:59:21 2020 +0800 [SPARK-30843][SQL] Fix getting of time components before 1582 year ### What changes were proposed in this pull request? 1. Rewrite DateTimeUtils methods `getHours()`, `getMinutes()`, `getSeconds()`, `getSecondsWithFraction()`, `getMilliseconds()` and `getMicroseconds()` using Java 8 time APIs. This will automatically switch the `Hour`, `Minute`, `Second` and `DatePart` expressions on Proleptic Gregorian calendar. 2. Remove unused methods and constant of DateTimeUtils - `to2001`, `YearZero `, `toYearZero` and `absoluteMicroSecond()`. 3. Remove unused value `timeZone` from `TimeZoneAwareExpression` since all expressions have been migrated to Java 8 time API, and legacy instance of `TimeZone` is not needed any more. 4. Change signatures of modified DateTimeUtils methods, and pass `ZoneId` instead of `TimeZone`. This will allow to avoid unnecessary conversions `TimeZone` -> `String` -> `ZoneId`. 5. Modify tests in `DateTimeUtilsSuite` and in `DateExpressionsSuite` to pass `ZoneId` instead of `TimeZone`. Correct the tests, to pass tested zone id instead of None. ### Why are the changes needed? The changes fix the issue of wrong results returned by the `hour()`, `minute()`, `second()`, `date_part('millisecond', ...)` and `date_part('microsecond', ....)`, see example in [SPARK-30843](https://issues.apache.org/jira/browse/SPARK-30843). ### Does this PR introduce any user-facing change? Yes. After the changes, the results of examples from SPARK-30843: ```sql spark-sql> select hour(timestamp '0010-01-01 00:00:00'); 0 spark-sql> select minute(timestamp '0010-01-01 00:00:00'); 0 spark-sql> select second(timestamp '0010-01-01 00:00:00'); 0 spark-sql> select date_part('milliseconds', timestamp '0010-01-01 00:00:00'); 0.000 spark-sql> select date_part('microseconds', timestamp '0010-01-01 00:00:00'); 0 ``` ### How was this patch tested? - By existing test suites `DateTimeUtilsSuite`, `DateExpressionsSuite` and `DateFunctionsSuite`. - Add new tests to `DateExpressionsSuite` and `DateTimeUtilsSuite` for 10 year, like: ```scala input = date(10, 1, 1, 0, 0, 0, 0, zonePST) assert(getHours(input, zonePST) === 0) ``` - Re-run `DateTimeBenchmark` using Amazon EC2. | Item | Description | | ---- | ----| | Region | us-west-2 (Oregon) | | Instance | r3.xlarge | | AMI | ami-06f2f779464715dc5 (ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20190722.1) | | Java | OpenJDK8/11 | Closes #27596 from MaxGekk/localtimestamp-greg-cal. Lead-authored-by: Maxim Gekk <max.g...@gmail.com> Co-authored-by: Max Gekk <max.g...@gmail.com> Co-authored-by: Ubuntu <ubu...@ip-172-31-1-30.us-west-2.compute.internal> Signed-off-by: Wenchen Fan <wenc...@databricks.com> (cherry picked from commit 9107f77f15cd0630dc981b6e8a9ca696b79e624f) Signed-off-by: Wenchen Fan <wenc...@databricks.com> --- .../catalyst/expressions/datetimeExpressions.scala | 37 ++- .../spark/sql/catalyst/util/DateTimeUtils.scala | 44 +-- .../expressions/DateExpressionsSuite.scala | 39 ++- .../sql/catalyst/util/DateTimeTestUtils.scala | 18 +- .../sql/catalyst/util/DateTimeUtilsSuite.scala | 173 +++++------ .../benchmarks/DateTimeBenchmark-jdk11-results.txt | 326 ++++++++++----------- sql/core/benchmarks/DateTimeBenchmark-results.txt | 326 ++++++++++----------- 7 files changed, 484 insertions(+), 479 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala index adf7251..05074d9 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala @@ -51,7 +51,6 @@ trait TimeZoneAwareExpression extends Expression { /** Returns a copy of this expression with the specified timeZoneId. */ def withTimeZone(timeZoneId: String): TimeZoneAwareExpression - @transient lazy val timeZone: TimeZone = DateTimeUtils.getTimeZone(timeZoneId.get) @transient lazy val zoneId: ZoneId = DateTimeUtils.getZoneId(timeZoneId.get) } @@ -229,13 +228,13 @@ case class Hour(child: Expression, timeZoneId: Option[String] = None) copy(timeZoneId = Option(timeZoneId)) override protected def nullSafeEval(timestamp: Any): Any = { - DateTimeUtils.getHours(timestamp.asInstanceOf[Long], timeZone) + DateTimeUtils.getHours(timestamp.asInstanceOf[Long], zoneId) } override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { - val tz = ctx.addReferenceObj("timeZone", timeZone) + val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName) val dtu = DateTimeUtils.getClass.getName.stripSuffix("$") - defineCodeGen(ctx, ev, c => s"$dtu.getHours($c, $tz)") + defineCodeGen(ctx, ev, c => s"$dtu.getHours($c, $zid)") } } @@ -260,13 +259,13 @@ case class Minute(child: Expression, timeZoneId: Option[String] = None) copy(timeZoneId = Option(timeZoneId)) override protected def nullSafeEval(timestamp: Any): Any = { - DateTimeUtils.getMinutes(timestamp.asInstanceOf[Long], timeZone) + DateTimeUtils.getMinutes(timestamp.asInstanceOf[Long], zoneId) } override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { - val tz = ctx.addReferenceObj("timeZone", timeZone) + val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName) val dtu = DateTimeUtils.getClass.getName.stripSuffix("$") - defineCodeGen(ctx, ev, c => s"$dtu.getMinutes($c, $tz)") + defineCodeGen(ctx, ev, c => s"$dtu.getMinutes($c, $zid)") } } @@ -291,13 +290,13 @@ case class Second(child: Expression, timeZoneId: Option[String] = None) copy(timeZoneId = Option(timeZoneId)) override protected def nullSafeEval(timestamp: Any): Any = { - DateTimeUtils.getSeconds(timestamp.asInstanceOf[Long], timeZone) + DateTimeUtils.getSeconds(timestamp.asInstanceOf[Long], zoneId) } override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { - val tz = ctx.addReferenceObj("timeZone", timeZone) + val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName) val dtu = DateTimeUtils.getClass.getName.stripSuffix("$") - defineCodeGen(ctx, ev, c => s"$dtu.getSeconds($c, $tz)") + defineCodeGen(ctx, ev, c => s"$dtu.getSeconds($c, $zid)") } } @@ -315,13 +314,13 @@ case class SecondWithFraction(child: Expression, timeZoneId: Option[String] = No copy(timeZoneId = Option(timeZoneId)) override protected def nullSafeEval(timestamp: Any): Any = { - DateTimeUtils.getSecondsWithFraction(timestamp.asInstanceOf[Long], timeZone) + DateTimeUtils.getSecondsWithFraction(timestamp.asInstanceOf[Long], zoneId) } override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { - val tz = ctx.addReferenceObj("timeZone", timeZone) + val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName) val dtu = DateTimeUtils.getClass.getName.stripSuffix("$") - defineCodeGen(ctx, ev, c => s"$dtu.getSecondsWithFraction($c, $tz)") + defineCodeGen(ctx, ev, c => s"$dtu.getSecondsWithFraction($c, $zid)") } } @@ -338,13 +337,13 @@ case class Milliseconds(child: Expression, timeZoneId: Option[String] = None) copy(timeZoneId = Option(timeZoneId)) override protected def nullSafeEval(timestamp: Any): Any = { - DateTimeUtils.getMilliseconds(timestamp.asInstanceOf[Long], timeZone) + DateTimeUtils.getMilliseconds(timestamp.asInstanceOf[Long], zoneId) } override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { - val tz = ctx.addReferenceObj("timeZone", timeZone) + val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName) val dtu = DateTimeUtils.getClass.getName.stripSuffix("$") - defineCodeGen(ctx, ev, c => s"$dtu.getMilliseconds($c, $tz)") + defineCodeGen(ctx, ev, c => s"$dtu.getMilliseconds($c, $zid)") } } @@ -357,13 +356,13 @@ case class Microseconds(child: Expression, timeZoneId: Option[String] = None) copy(timeZoneId = Option(timeZoneId)) override protected def nullSafeEval(timestamp: Any): Any = { - DateTimeUtils.getMicroseconds(timestamp.asInstanceOf[Long], timeZone) + DateTimeUtils.getMicroseconds(timestamp.asInstanceOf[Long], zoneId) } override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { - val tz = ctx.addReferenceObj("timeZone", timeZone) + val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName) val dtu = DateTimeUtils.getClass.getName.stripSuffix("$") - defineCodeGen(ctx, ev, c => s"$dtu.getMicroseconds($c, $tz)") + defineCodeGen(ctx, ev, c => s"$dtu.getMicroseconds($c, $zid)") } } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala index ce0c138..768dde0 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala @@ -47,12 +47,6 @@ object DateTimeUtils { // it's 2440587.5, rounding up to compatible with Hive final val JULIAN_DAY_OF_EPOCH = 2440588 - // number of days between 1.1.1970 and 1.1.2001 - final val to2001 = -11323 - - // this is year -17999, calculation: 50 * daysIn400Year - final val YearZero = -17999 - final val toYearZero = to2001 + 7304850 final val TimeZoneGMT = TimeZone.getTimeZone("GMT") final val TimeZoneUTC = TimeZone.getTimeZone("UTC") @@ -411,63 +405,55 @@ object DateTimeUtils { } } - /** - * Returns the microseconds since year zero (-17999) from microseconds since epoch. - */ - private def absoluteMicroSecond(microsec: SQLTimestamp): SQLTimestamp = { - microsec + toYearZero * MICROS_PER_DAY - } - - private def localTimestamp(microsec: SQLTimestamp, timeZone: TimeZone): SQLTimestamp = { - val zoneOffsetUs = MILLISECONDS.toMicros(timeZone.getOffset(MICROSECONDS.toMillis(microsec))) - absoluteMicroSecond(microsec) + zoneOffsetUs + private def localTimestamp(microsec: SQLTimestamp, zoneId: ZoneId): LocalDateTime = { + microsToInstant(microsec).atZone(zoneId).toLocalDateTime } /** * Returns the hour value of a given timestamp value. The timestamp is expressed in microseconds. */ - def getHours(microsec: SQLTimestamp, timeZone: TimeZone): Int = { - (MICROSECONDS.toHours(localTimestamp(microsec, timeZone)) % 24).toInt + def getHours(microsec: SQLTimestamp, zoneId: ZoneId): Int = { + localTimestamp(microsec, zoneId).getHour } /** * Returns the minute value of a given timestamp value. The timestamp is expressed in * microseconds. */ - def getMinutes(microsec: SQLTimestamp, timeZone: TimeZone): Int = { - (MICROSECONDS.toMinutes(localTimestamp(microsec, timeZone)) % 60).toInt + def getMinutes(microsec: SQLTimestamp, zoneId: ZoneId): Int = { + localTimestamp(microsec, zoneId).getMinute } /** * Returns the second value of a given timestamp value. The timestamp is expressed in * microseconds. */ - def getSeconds(microsec: SQLTimestamp, timeZone: TimeZone): Int = { - (MICROSECONDS.toSeconds(localTimestamp(microsec, timeZone)) % 60).toInt + def getSeconds(microsec: SQLTimestamp, zoneId: ZoneId): Int = { + localTimestamp(microsec, zoneId).getSecond } /** * Returns the seconds part and its fractional part with microseconds. */ - def getSecondsWithFraction(microsec: SQLTimestamp, timeZone: TimeZone): Decimal = { - val secFrac = localTimestamp(microsec, timeZone) % (MILLIS_PER_MINUTE * MICROS_PER_MILLIS) - Decimal(secFrac, 8, 6) + def getSecondsWithFraction(microsec: SQLTimestamp, zoneId: ZoneId): Decimal = { + Decimal(getMicroseconds(microsec, zoneId), 8, 6) } /** * Returns seconds, including fractional parts, multiplied by 1000. The timestamp * is expressed in microseconds since the epoch. */ - def getMilliseconds(timestamp: SQLTimestamp, timeZone: TimeZone): Decimal = { - Decimal(getMicroseconds(timestamp, timeZone), 8, 3) + def getMilliseconds(timestamp: SQLTimestamp, zoneId: ZoneId): Decimal = { + Decimal(getMicroseconds(timestamp, zoneId), 8, 3) } /** * Returns seconds, including fractional parts, multiplied by 1000000. The timestamp * is expressed in microseconds since the epoch. */ - def getMicroseconds(timestamp: SQLTimestamp, timeZone: TimeZone): Int = { - Math.floorMod(localTimestamp(timestamp, timeZone), MICROS_PER_SECOND * 60).toInt + def getMicroseconds(timestamp: SQLTimestamp, zoneId: ZoneId): Int = { + val lt = localTimestamp(timestamp, zoneId) + (lt.getLong(ChronoField.MICRO_OF_SECOND) + lt.getSecond * MICROS_PER_SECOND).toInt } /** diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala index 39b859a..a514c90 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala @@ -1060,22 +1060,31 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { outstandingTimezonesIds.foreach { timezone => var timestamp = MakeTimestamp(Literal(2019), Literal(8), Literal(10), Literal(0), Literal(0), Literal(Decimal(BigDecimal(10.123456789), 8, 6)), - Some(Literal(timezone))) + Some(Literal(timezone)), Some(timezone)) + def millis(ts: MakeTimestamp): Milliseconds = Milliseconds(timestamp, Some(timezone)) + def micros(ts: MakeTimestamp): Microseconds = Microseconds(timestamp, Some(timezone)) - checkEvaluation(Milliseconds(timestamp), Decimal(BigDecimal(10123.457), 8, 3)) - checkEvaluation(Microseconds(timestamp), 10123457) + checkEvaluation(millis(timestamp), Decimal(BigDecimal(10123.457), 8, 3)) + checkEvaluation( + millis(timestamp.copy(year = Literal(10))), + Decimal(BigDecimal(10123.457), 8, 3)) + + checkEvaluation(micros(timestamp), 10123457) + checkEvaluation( + micros(timestamp.copy(year = Literal(10))), + 10123457) timestamp = timestamp.copy(sec = Literal(Decimal(0.0, 8, 6))) - checkEvaluation(Milliseconds(timestamp), Decimal(0, 8, 3)) - checkEvaluation(Microseconds(timestamp), 0) + checkEvaluation(millis(timestamp), Decimal(0, 8, 3)) + checkEvaluation(micros(timestamp), 0) timestamp = timestamp.copy(sec = Literal(Decimal(BigDecimal(59.999999), 8, 6))) - checkEvaluation(Milliseconds(timestamp), Decimal(BigDecimal(59999.999), 8, 3)) - checkEvaluation(Microseconds(timestamp), 59999999) + checkEvaluation(millis(timestamp), Decimal(BigDecimal(59999.999), 8, 3)) + checkEvaluation(micros(timestamp), 59999999) timestamp = timestamp.copy(sec = Literal(Decimal(BigDecimal(60.0), 8, 6))) - checkEvaluation(Milliseconds(timestamp), Decimal(0, 8, 3)) - checkEvaluation(Microseconds(timestamp), 0) + checkEvaluation(millis(timestamp), Decimal(0, 8, 3)) + checkEvaluation(micros(timestamp), 0) } } @@ -1103,15 +1112,19 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { outstandingTimezonesIds.foreach { timezone => val timestamp = MakeTimestamp(Literal(2019), Literal(8), Literal(10), Literal(0), Literal(0), Literal(Decimal(10.123456, 8, 6)), - Some(Literal(timezone))) + Some(Literal(timezone)), Some(timezone)) + def secFrac(ts: MakeTimestamp): SecondWithFraction = SecondWithFraction(ts, Some(timezone)) - checkEvaluation(SecondWithFraction(timestamp), Decimal(10.123456, 8, 6)) + checkEvaluation(secFrac(timestamp), Decimal(10.123456, 8, 6)) checkEvaluation( - SecondWithFraction(timestamp.copy(sec = Literal(Decimal(59000001, 8, 6)))), + secFrac(timestamp.copy(sec = Literal(Decimal(59000001, 8, 6)))), Decimal(59000001, 8, 6)) checkEvaluation( - SecondWithFraction(timestamp.copy(sec = Literal(Decimal(1, 8, 6)))), + secFrac(timestamp.copy(sec = Literal(Decimal(1, 8, 6)))), Decimal(0.000001, 8, 6)) + checkEvaluation( + secFrac(timestamp.copy(year = Literal(10))), + Decimal(10.123456, 8, 6)) } } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala index 4dfeb85..8d16007 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala @@ -17,12 +17,10 @@ package org.apache.spark.sql.catalyst.util -import java.time.{LocalDate, LocalDateTime, LocalTime, ZoneId} +import java.time.{LocalDate, LocalDateTime, LocalTime, ZoneId, ZoneOffset} import java.util.TimeZone import java.util.concurrent.TimeUnit -import org.apache.spark.sql.catalyst.util.DateTimeUtils.TimeZoneUTC - /** * Helper functions for testing date and time functionality. */ @@ -52,8 +50,8 @@ object DateTimeTestUtils { } } - def localDateTimeToMicros(localDateTime: LocalDateTime, tz: TimeZone): Long = { - val instant = localDateTime.atZone(tz.toZoneId).toInstant + def localDateTimeToMicros(localDateTime: LocalDateTime, zoneId: ZoneId): Long = { + val instant = localDateTime.atZone(zoneId).toInstant DateTimeUtils.instantToMicros(instant) } @@ -66,10 +64,10 @@ object DateTimeTestUtils { minute: Byte = 0, sec: Byte = 0, micros: Int = 0, - tz: TimeZone = TimeZoneUTC): Long = { + zid: ZoneId = ZoneOffset.UTC): Long = { val nanos = TimeUnit.MICROSECONDS.toNanos(micros).toInt val localDateTime = LocalDateTime.of(year, month, day, hour, minute, sec, nanos) - localDateTimeToMicros(localDateTime, tz) + localDateTimeToMicros(localDateTime, zid) } // Returns number of days since epoch for the given date @@ -90,11 +88,11 @@ object DateTimeTestUtils { minute: Byte = 0, sec: Byte = 0, micros: Int = 0, - tz: TimeZone = TimeZoneUTC): Long = { + zid: ZoneId = ZoneOffset.UTC): Long = { val nanos = TimeUnit.MICROSECONDS.toNanos(micros).toInt - val localDate = LocalDate.now(tz.toZoneId) + val localDate = LocalDate.now(zid) val localTime = LocalTime.of(hour, minute, sec, nanos) val localDateTime = LocalDateTime.of(localDate, localTime) - localDateTimeToMicros(localDateTime, tz) + localDateTimeToMicros(localDateTime, zid) } } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala index ff4d8a2..6ed18ca 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala @@ -34,7 +34,9 @@ import org.apache.spark.unsafe.types.UTF8String class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper { - val TimeZonePST = TimeZone.getTimeZone("PST") + val zonePST = getZoneId("PST") + val zoneGMT = getZoneId("GMT") + private def defaultZoneId = ZoneId.systemDefault() test("nanoseconds truncation") { @@ -163,87 +165,88 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper { def checkStringToTimestamp(str: String, expected: Option[Long]): Unit = { assert(toTimestamp(str, tz.toZoneId) === expected) } + val zid = tz.toZoneId - checkStringToTimestamp("1969-12-31 16:00:00", Option(date(1969, 12, 31, 16, tz = tz))) - checkStringToTimestamp("0001", Option(date(1, 1, 1, 0, tz = tz))) - checkStringToTimestamp("2015-03", Option(date(2015, 3, 1, tz = tz))) + checkStringToTimestamp("1969-12-31 16:00:00", Option(date(1969, 12, 31, 16, zid = zid))) + checkStringToTimestamp("0001", Option(date(1, 1, 1, 0, zid = zid))) + checkStringToTimestamp("2015-03", Option(date(2015, 3, 1, zid = zid))) Seq("2015-03-18", "2015-03-18 ", " 2015-03-18", " 2015-03-18 ", "2015-03-18T").foreach { s => - checkStringToTimestamp(s, Option(date(2015, 3, 18, tz = tz))) + checkStringToTimestamp(s, Option(date(2015, 3, 18, zid = zid))) } - var expected = Option(date(2015, 3, 18, 12, 3, 17, tz = tz)) + var expected = Option(date(2015, 3, 18, 12, 3, 17, zid = zid)) checkStringToTimestamp("2015-03-18 12:03:17", expected) checkStringToTimestamp("2015-03-18T12:03:17", expected) // If the string value includes timezone string, it represents the timestamp string // in the timezone regardless of the tz parameter. - var timeZone = TimeZone.getTimeZone("GMT-13:53") - expected = Option(date(2015, 3, 18, 12, 3, 17, tz = timeZone)) + var zoneId = getZoneId("GMT-13:53") + expected = Option(date(2015, 3, 18, 12, 3, 17, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17-13:53", expected) - timeZone = TimeZone.getTimeZone("UTC") - expected = Option(date(2015, 3, 18, 12, 3, 17, tz = timeZone)) + zoneId = getZoneId("UTC") + expected = Option(date(2015, 3, 18, 12, 3, 17, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17Z", expected) checkStringToTimestamp("2015-03-18 12:03:17Z", expected) - timeZone = TimeZone.getTimeZone("GMT-01:00") - expected = Option(date(2015, 3, 18, 12, 3, 17, tz = timeZone)) + zoneId = getZoneId("GMT-01:00") + expected = Option(date(2015, 3, 18, 12, 3, 17, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17-1:0", expected) checkStringToTimestamp("2015-03-18T12:03:17-01:00", expected) - timeZone = TimeZone.getTimeZone("GMT+07:30") - expected = Option(date(2015, 3, 18, 12, 3, 17, tz = timeZone)) + zoneId = getZoneId("GMT+07:30") + expected = Option(date(2015, 3, 18, 12, 3, 17, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17+07:30", expected) - timeZone = TimeZone.getTimeZone("GMT+07:03") - expected = Option(date(2015, 3, 18, 12, 3, 17, tz = timeZone)) + zoneId = getZoneId("GMT+07:03") + expected = Option(date(2015, 3, 18, 12, 3, 17, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17+07:03", expected) // tests for the string including milliseconds. - expected = Option(date(2015, 3, 18, 12, 3, 17, 123000, tz = tz)) + expected = Option(date(2015, 3, 18, 12, 3, 17, 123000, zid = zid)) checkStringToTimestamp("2015-03-18 12:03:17.123", expected) checkStringToTimestamp("2015-03-18T12:03:17.123", expected) // If the string value includes timezone string, it represents the timestamp string // in the timezone regardless of the tz parameter. - timeZone = TimeZone.getTimeZone("UTC") - expected = Option(date(2015, 3, 18, 12, 3, 17, 456000, tz = timeZone)) + zoneId = getZoneId("UTC") + expected = Option(date(2015, 3, 18, 12, 3, 17, 456000, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17.456Z", expected) checkStringToTimestamp("2015-03-18 12:03:17.456Z", expected) - timeZone = TimeZone.getTimeZone("GMT-01:00") - expected = Option(date(2015, 3, 18, 12, 3, 17, 123000, tz = timeZone)) + zoneId = getZoneId("GMT-01:00") + expected = Option(date(2015, 3, 18, 12, 3, 17, 123000, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17.123-1:0", expected) checkStringToTimestamp("2015-03-18T12:03:17.123-01:00", expected) - timeZone = TimeZone.getTimeZone("GMT+07:30") - expected = Option(date(2015, 3, 18, 12, 3, 17, 123000, tz = timeZone)) + zoneId = getZoneId("GMT+07:30") + expected = Option(date(2015, 3, 18, 12, 3, 17, 123000, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17.123+07:30", expected) - timeZone = TimeZone.getTimeZone("GMT+07:30") - expected = Option(date(2015, 3, 18, 12, 3, 17, 123000, tz = timeZone)) + zoneId = getZoneId("GMT+07:30") + expected = Option(date(2015, 3, 18, 12, 3, 17, 123000, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17.123+07:30", expected) - timeZone = TimeZone.getTimeZone("GMT+07:30") - expected = Option(date(2015, 3, 18, 12, 3, 17, 123121, tz = timeZone)) + zoneId = getZoneId("GMT+07:30") + expected = Option(date(2015, 3, 18, 12, 3, 17, 123121, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17.123121+7:30", expected) - timeZone = TimeZone.getTimeZone("GMT+07:30") - expected = Option(date(2015, 3, 18, 12, 3, 17, 123120, tz = timeZone)) + zoneId = getZoneId("GMT+07:30") + expected = Option(date(2015, 3, 18, 12, 3, 17, 123120, zid = zoneId)) checkStringToTimestamp("2015-03-18T12:03:17.12312+7:30", expected) - expected = Option(time(18, 12, 15, tz = tz)) + expected = Option(time(18, 12, 15, zid = zid)) checkStringToTimestamp("18:12:15", expected) - timeZone = TimeZone.getTimeZone("GMT+07:30") - expected = Option(time(18, 12, 15, 123120, tz = timeZone)) + zoneId = getZoneId("GMT+07:30") + expected = Option(time(18, 12, 15, 123120, zid = zoneId)) checkStringToTimestamp("T18:12:15.12312+7:30", expected) - timeZone = TimeZone.getTimeZone("GMT+07:30") - expected = Option(time(18, 12, 15, 123120, tz = timeZone)) + zoneId = getZoneId("GMT+07:30") + expected = Option(time(18, 12, 15, 123120, zid = zoneId)) checkStringToTimestamp("18:12:15.12312+7:30", expected) - expected = Option(date(2011, 5, 6, 7, 8, 9, 100000, tz = tz)) + expected = Option(date(2011, 5, 6, 7, 8, 9, 100000, zid = zid)) checkStringToTimestamp("2011-05-06 07:08:09.1000", expected) checkStringToTimestamp("238", None) @@ -265,8 +268,8 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper { checkStringToTimestamp("1999 08", None) // Truncating the fractional seconds - timeZone = TimeZone.getTimeZone("GMT+00:00") - expected = Option(date(2015, 3, 18, 12, 3, 17, 123456, tz = timeZone)) + zoneId = getZoneId("GMT+00:00") + expected = Option(date(2015, 3, 18, 12, 3, 17, 123456, zid = zoneId)) checkStringToTimestamp( "2015-03-18T12:03:17.123456789+0:00", expected) } @@ -290,32 +293,38 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper { } test("hours") { - var input = date(2015, 3, 18, 13, 2, 11, 0, TimeZonePST) - assert(getHours(input, TimeZonePST) === 13) - assert(getHours(input, TimeZoneGMT) === 20) - input = date(2015, 12, 8, 2, 7, 9, 0, TimeZonePST) - assert(getHours(input, TimeZonePST) === 2) - assert(getHours(input, TimeZoneGMT) === 10) + var input = date(2015, 3, 18, 13, 2, 11, 0, zonePST) + assert(getHours(input, zonePST) === 13) + assert(getHours(input, zoneGMT) === 20) + input = date(2015, 12, 8, 2, 7, 9, 0, zonePST) + assert(getHours(input, zonePST) === 2) + assert(getHours(input, zoneGMT) === 10) + input = date(10, 1, 1, 0, 0, 0, 0, zonePST) + assert(getHours(input, zonePST) === 0) } test("minutes") { - var input = date(2015, 3, 18, 13, 2, 11, 0, TimeZonePST) - assert(getMinutes(input, TimeZonePST) === 2) - assert(getMinutes(input, TimeZoneGMT) === 2) - assert(getMinutes(input, TimeZone.getTimeZone("Australia/North")) === 32) - input = date(2015, 3, 8, 2, 7, 9, 0, TimeZonePST) - assert(getMinutes(input, TimeZonePST) === 7) - assert(getMinutes(input, TimeZoneGMT) === 7) - assert(getMinutes(input, TimeZone.getTimeZone("Australia/North")) === 37) + var input = date(2015, 3, 18, 13, 2, 11, 0, zonePST) + assert(getMinutes(input, zonePST) === 2) + assert(getMinutes(input, zoneGMT) === 2) + assert(getMinutes(input, getZoneId("Australia/North")) === 32) + input = date(2015, 3, 8, 2, 7, 9, 0, zonePST) + assert(getMinutes(input, zonePST) === 7) + assert(getMinutes(input, zoneGMT) === 7) + assert(getMinutes(input, getZoneId("Australia/North")) === 37) + input = date(10, 1, 1, 0, 0, 0, 0, zonePST) + assert(getMinutes(input, zonePST) === 0) } test("seconds") { - var input = date(2015, 3, 18, 13, 2, 11, 0, TimeZonePST) - assert(getSeconds(input, TimeZonePST) === 11) - assert(getSeconds(input, TimeZoneGMT) === 11) - input = date(2015, 3, 8, 2, 7, 9, 0, TimeZonePST) - assert(getSeconds(input, TimeZonePST) === 9) - assert(getSeconds(input, TimeZoneGMT) === 9) + var input = date(2015, 3, 18, 13, 2, 11, 0, zonePST) + assert(getSeconds(input, zonePST) === 11) + assert(getSeconds(input, zoneGMT) === 11) + input = date(2015, 3, 8, 2, 7, 9, 0, zonePST) + assert(getSeconds(input, zonePST) === 9) + assert(getSeconds(input, zoneGMT) === 9) + input = date(10, 1, 1, 0, 0, 0, 0, zonePST) + assert(getSeconds(input, zonePST) === 0) } test("hours / minutes / seconds") { @@ -381,37 +390,37 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper { val ts2 = date(2000, 2, 28, 10, 30, 0, 123000) assert(timestampAddInterval(ts1, 36, 0, 123000, defaultZoneId) === ts2) - val ts3 = date(1997, 2, 27, 16, 0, 0, 0, TimeZonePST) - val ts4 = date(2000, 2, 27, 16, 0, 0, 123000, TimeZonePST) - val ts5 = date(2000, 2, 28, 0, 0, 0, 123000, TimeZoneGMT) - assert(timestampAddInterval(ts3, 36, 0, 123000, TimeZonePST.toZoneId) === ts4) - assert(timestampAddInterval(ts3, 36, 0, 123000, TimeZoneGMT.toZoneId) === ts5) + val ts3 = date(1997, 2, 27, 16, 0, 0, 0, zonePST) + val ts4 = date(2000, 2, 27, 16, 0, 0, 123000, zonePST) + val ts5 = date(2000, 2, 28, 0, 0, 0, 123000, zoneGMT) + assert(timestampAddInterval(ts3, 36, 0, 123000, zonePST) === ts4) + assert(timestampAddInterval(ts3, 36, 0, 123000, zoneGMT) === ts5) } test("timestamp add days") { // 2019-3-9 is the end of Pacific Standard Time - val ts1 = date(2019, 3, 9, 12, 0, 0, 123000, TimeZonePST) + val ts1 = date(2019, 3, 9, 12, 0, 0, 123000, zonePST) // 2019-3-10 is the start of Pacific Daylight Time - val ts2 = date(2019, 3, 10, 12, 0, 0, 123000, TimeZonePST) - val ts3 = date(2019, 5, 9, 12, 0, 0, 123000, TimeZonePST) - val ts4 = date(2019, 5, 10, 12, 0, 0, 123000, TimeZonePST) + val ts2 = date(2019, 3, 10, 12, 0, 0, 123000, zonePST) + val ts3 = date(2019, 5, 9, 12, 0, 0, 123000, zonePST) + val ts4 = date(2019, 5, 10, 12, 0, 0, 123000, zonePST) // 2019-11-2 is the end of Pacific Daylight Time - val ts5 = date(2019, 11, 2, 12, 0, 0, 123000, TimeZonePST) + val ts5 = date(2019, 11, 2, 12, 0, 0, 123000, zonePST) // 2019-11-3 is the start of Pacific Standard Time - val ts6 = date(2019, 11, 3, 12, 0, 0, 123000, TimeZonePST) + val ts6 = date(2019, 11, 3, 12, 0, 0, 123000, zonePST) // transit from Pacific Standard Time to Pacific Daylight Time assert(timestampAddInterval( - ts1, 0, 0, 23 * MICROS_PER_HOUR, TimeZonePST.toZoneId) === ts2) - assert(timestampAddInterval(ts1, 0, 1, 0, TimeZonePST.toZoneId) === ts2) + ts1, 0, 0, 23 * MICROS_PER_HOUR, zonePST) === ts2) + assert(timestampAddInterval(ts1, 0, 1, 0, zonePST) === ts2) // just a normal day assert(timestampAddInterval( - ts3, 0, 0, 24 * MICROS_PER_HOUR, TimeZonePST.toZoneId) === ts4) - assert(timestampAddInterval(ts3, 0, 1, 0, TimeZonePST.toZoneId) === ts4) + ts3, 0, 0, 24 * MICROS_PER_HOUR, zonePST) === ts4) + assert(timestampAddInterval(ts3, 0, 1, 0, zonePST) === ts4) // transit from Pacific Daylight Time to Pacific Standard Time assert(timestampAddInterval( - ts5, 0, 0, 25 * MICROS_PER_HOUR, TimeZonePST.toZoneId) === ts6) - assert(timestampAddInterval(ts5, 0, 1, 0, TimeZonePST.toZoneId) === ts6) + ts5, 0, 0, 25 * MICROS_PER_HOUR, zonePST) === ts6) + assert(timestampAddInterval(ts5, 0, 1, 0, zonePST) === ts6) } test("monthsBetween") { @@ -428,9 +437,9 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper { assert(monthsBetween(date1, date2, roundOff, ZoneOffset.UTC) === 11) } - val date3 = date(2000, 2, 28, 16, tz = TimeZonePST) - val date4 = date(1997, 2, 28, 16, tz = TimeZonePST) - assert(monthsBetween(date3, date4, true, TimeZonePST.toZoneId) === 36.0) + val date3 = date(2000, 2, 28, 16, zid = zonePST) + val date4 = date(1997, 2, 28, 16, zid = zonePST) + assert(monthsBetween(date3, date4, true, zonePST) === 36.0) assert(monthsBetween(date3, date4, true, ZoneOffset.UTC) === 35.90322581) assert(monthsBetween(date3, date4, false, ZoneOffset.UTC) === 35.903225806451616) } @@ -575,15 +584,15 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper { } test("daysToMillis and millisToDays") { - val input = TimeUnit.MICROSECONDS.toMillis(date(2015, 12, 31, 16, tz = TimeZonePST)) - assert(millisToDays(input, TimeZonePST.toZoneId) === 16800) + val input = TimeUnit.MICROSECONDS.toMillis(date(2015, 12, 31, 16, zid = zonePST)) + assert(millisToDays(input, zonePST) === 16800) assert(millisToDays(input, ZoneOffset.UTC) === 16801) assert(millisToDays(-1 * MILLIS_PER_DAY + 1, ZoneOffset.UTC) == -1) - var expected = TimeUnit.MICROSECONDS.toMillis(date(2015, 12, 31, tz = TimeZonePST)) - assert(daysToMillis(16800, TimeZonePST.toZoneId) === expected) + var expected = TimeUnit.MICROSECONDS.toMillis(date(2015, 12, 31, zid = zonePST)) + assert(daysToMillis(16800, zonePST) === expected) - expected = TimeUnit.MICROSECONDS.toMillis(date(2015, 12, 31, tz = TimeZoneGMT)) + expected = TimeUnit.MICROSECONDS.toMillis(date(2015, 12, 31, zid = zoneGMT)) assert(daysToMillis(16800, ZoneOffset.UTC) === expected) // There are some days are skipped entirely in some timezone, skip them here. diff --git a/sql/core/benchmarks/DateTimeBenchmark-jdk11-results.txt b/sql/core/benchmarks/DateTimeBenchmark-jdk11-results.txt index 729b112..7d9b147 100644 --- a/sql/core/benchmarks/DateTimeBenchmark-jdk11-results.txt +++ b/sql/core/benchmarks/DateTimeBenchmark-jdk11-results.txt @@ -2,428 +2,428 @@ Extract components ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz cast to timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -cast to timestamp wholestage off 546 572 36 18.3 54.6 1.0X -cast to timestamp wholestage on 412 438 16 24.3 41.2 1.3X +cast to timestamp wholestage off 408 445 53 24.5 40.8 1.0X +cast to timestamp wholestage on 401 453 63 24.9 40.1 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz year of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -year of timestamp wholestage off 1240 1295 77 8.1 124.0 1.0X -year of timestamp wholestage on 1109 1130 24 9.0 110.9 1.1X +year of timestamp wholestage off 1197 1246 69 8.4 119.7 1.0X +year of timestamp wholestage on 1111 1123 10 9.0 111.1 1.1X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz quarter of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -quarter of timestamp wholestage off 1572 1574 3 6.4 157.2 1.0X -quarter of timestamp wholestage on 1386 1405 18 7.2 138.6 1.1X +quarter of timestamp wholestage off 1451 1462 16 6.9 145.1 1.0X +quarter of timestamp wholestage on 1409 1424 13 7.1 140.9 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz month of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -month of timestamp wholestage off 1194 1196 2 8.4 119.4 1.0X -month of timestamp wholestage on 1057 1069 12 9.5 105.7 1.1X +month of timestamp wholestage off 1106 1109 3 9.0 110.6 1.0X +month of timestamp wholestage on 1092 1095 4 9.2 109.2 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz weekofyear of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -weekofyear of timestamp wholestage off 2070 2071 2 4.8 207.0 1.0X -weekofyear of timestamp wholestage on 1549 1555 6 6.5 154.9 1.3X +weekofyear of timestamp wholestage off 1675 1677 3 6.0 167.5 1.0X +weekofyear of timestamp wholestage on 1616 1625 7 6.2 161.6 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz day of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -day of timestamp wholestage off 1173 1186 18 8.5 117.3 1.0X -day of timestamp wholestage on 1056 1076 26 9.5 105.6 1.1X +day of timestamp wholestage off 1111 1115 6 9.0 111.1 1.0X +day of timestamp wholestage on 1090 1098 10 9.2 109.0 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz dayofyear of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -dayofyear of timestamp wholestage off 1207 1211 6 8.3 120.7 1.0X -dayofyear of timestamp wholestage on 1097 1108 9 9.1 109.7 1.1X +dayofyear of timestamp wholestage off 1162 1167 7 8.6 116.2 1.0X +dayofyear of timestamp wholestage on 1136 1142 6 8.8 113.6 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz dayofmonth of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -dayofmonth of timestamp wholestage off 1184 1190 8 8.4 118.4 1.0X -dayofmonth of timestamp wholestage on 1053 1060 9 9.5 105.3 1.1X +dayofmonth of timestamp wholestage off 1102 1107 7 9.1 110.2 1.0X +dayofmonth of timestamp wholestage on 1092 1111 16 9.2 109.2 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz dayofweek of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -dayofweek of timestamp wholestage off 1343 1362 27 7.4 134.3 1.0X -dayofweek of timestamp wholestage on 1228 1239 7 8.1 122.8 1.1X +dayofweek of timestamp wholestage off 1254 1260 9 8.0 125.4 1.0X +dayofweek of timestamp wholestage on 1264 1269 7 7.9 126.4 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz weekday of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -weekday of timestamp wholestage off 1276 1278 3 7.8 127.6 1.0X -weekday of timestamp wholestage on 1160 1181 22 8.6 116.0 1.1X +weekday of timestamp wholestage off 1211 1215 5 8.3 121.1 1.0X +weekday of timestamp wholestage on 1197 1206 12 8.4 119.7 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz hour of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -hour of timestamp wholestage off 854 862 12 11.7 85.4 1.0X -hour of timestamp wholestage on 741 748 6 13.5 74.1 1.2X +hour of timestamp wholestage off 899 904 6 11.1 89.9 1.0X +hour of timestamp wholestage on 823 827 3 12.2 82.3 1.1X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz minute of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -minute of timestamp wholestage off 853 854 1 11.7 85.3 1.0X -minute of timestamp wholestage on 730 737 11 13.7 73.0 1.2X +minute of timestamp wholestage off 906 923 24 11.0 90.6 1.0X +minute of timestamp wholestage on 821 830 13 12.2 82.1 1.1X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz second of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -second of timestamp wholestage off 726 728 2 13.8 72.6 1.0X -second of timestamp wholestage on 614 623 9 16.3 61.4 1.2X +second of timestamp wholestage off 902 908 7 11.1 90.2 1.0X +second of timestamp wholestage on 823 833 9 12.2 82.3 1.1X ================================================================================================ Current date and time ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz current_date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -current_date wholestage off 369 370 2 27.1 36.9 1.0X -current_date wholestage on 277 284 8 36.2 27.7 1.3X +current_date wholestage off 300 301 2 33.3 30.0 1.0X +current_date wholestage on 309 312 3 32.4 30.9 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz current_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -current_timestamp wholestage off 410 411 1 24.4 41.0 1.0X -current_timestamp wholestage on 283 418 259 35.4 28.3 1.5X +current_timestamp wholestage off 303 337 47 33.0 30.3 1.0X +current_timestamp wholestage on 320 448 160 31.3 32.0 0.9X ================================================================================================ Date arithmetic ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz cast to date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -cast to date wholestage off 987 992 7 10.1 98.7 1.0X -cast to date wholestage on 891 896 4 11.2 89.1 1.1X +cast to date wholestage off 910 912 2 11.0 91.0 1.0X +cast to date wholestage on 930 937 6 10.8 93.0 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz last_day: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -last_day wholestage off 1179 1179 1 8.5 117.9 1.0X -last_day wholestage on 1052 1080 44 9.5 105.2 1.1X +last_day wholestage off 1122 1123 1 8.9 112.2 1.0X +last_day wholestage on 1100 1109 6 9.1 110.0 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz next_day: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -next_day wholestage off 1073 1081 11 9.3 107.3 1.0X -next_day wholestage on 948 955 10 10.5 94.8 1.1X +next_day wholestage off 991 992 2 10.1 99.1 1.0X +next_day wholestage on 981 984 4 10.2 98.1 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_add: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_add wholestage off 1006 1009 5 9.9 100.6 1.0X -date_add wholestage on 867 870 4 11.5 86.7 1.2X +date_add wholestage off 927 927 1 10.8 92.7 1.0X +date_add wholestage on 908 915 12 11.0 90.8 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_sub: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_sub wholestage off 980 988 11 10.2 98.0 1.0X -date_sub wholestage on 866 873 9 11.6 86.6 1.1X +date_sub wholestage off 921 921 0 10.9 92.1 1.0X +date_sub wholestage on 907 910 4 11.0 90.7 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz add_months: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -add_months wholestage off 1329 1332 4 7.5 132.9 1.0X -add_months wholestage on 1199 1206 8 8.3 119.9 1.1X +add_months wholestage off 1255 1257 3 8.0 125.5 1.0X +add_months wholestage on 1242 1259 13 8.1 124.2 1.0X ================================================================================================ Formatting dates ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz format date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -format date wholestage off 4724 4736 18 2.1 472.4 1.0X -format date wholestage on 4550 4574 26 2.2 455.0 1.0X +format date wholestage off 4912 4968 79 2.0 491.2 1.0X +format date wholestage on 4734 4757 16 2.1 473.4 1.0X ================================================================================================ Formatting timestamps ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz from_unixtime: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -from_unixtime wholestage off 7171 7183 17 1.4 717.1 1.0X -from_unixtime wholestage on 7114 7141 20 1.4 711.4 1.0X +from_unixtime wholestage off 8692 8701 13 1.2 869.2 1.0X +from_unixtime wholestage on 8717 8730 14 1.1 871.7 1.0X ================================================================================================ Convert timestamps ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz from_utc_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -from_utc_timestamp wholestage off 1498 1504 8 6.7 149.8 1.0X -from_utc_timestamp wholestage on 1399 1405 5 7.1 139.9 1.1X +from_utc_timestamp wholestage off 1339 1348 12 7.5 133.9 1.0X +from_utc_timestamp wholestage on 1398 1404 6 7.2 139.8 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to_utc_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to_utc_timestamp wholestage off 1505 1507 2 6.6 150.5 1.0X -to_utc_timestamp wholestage on 1396 1401 5 7.2 139.6 1.1X +to_utc_timestamp wholestage off 1936 1951 21 5.2 193.6 1.0X +to_utc_timestamp wholestage on 1783 1792 8 5.6 178.3 1.1X ================================================================================================ Intervals ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz cast interval: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -cast interval wholestage off 423 428 7 23.6 42.3 1.0X -cast interval wholestage on 300 302 2 33.3 30.0 1.4X +cast interval wholestage off 350 353 4 28.6 35.0 1.0X +cast interval wholestage on 348 355 4 28.7 34.8 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz datediff: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -datediff wholestage off 1626 1630 6 6.1 162.6 1.0X -datediff wholestage on 1467 1471 3 6.8 146.7 1.1X +datediff wholestage off 1679 1680 2 6.0 167.9 1.0X +datediff wholestage on 1674 1687 11 6.0 167.4 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz months_between: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -months_between wholestage off 1988 1992 5 5.0 198.8 1.0X -months_between wholestage on 1812 1834 24 5.5 181.2 1.1X +months_between wholestage off 4116 4120 5 2.4 411.6 1.0X +months_between wholestage on 4092 4140 90 2.4 409.2 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz window: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -window wholestage off 2277 2334 80 0.4 2277.1 1.0X -window wholestage on 48996 49048 67 0.0 48996.0 0.0X +window wholestage off 2236 2396 227 0.4 2235.9 1.0X +window wholestage on 47208 47298 171 0.0 47208.3 0.0X ================================================================================================ Truncation ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc YEAR: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc YEAR wholestage off 867 870 6 11.5 86.7 1.0X -date_trunc YEAR wholestage on 815 819 6 12.3 81.5 1.1X +date_trunc YEAR wholestage off 1939 1947 11 5.2 193.9 1.0X +date_trunc YEAR wholestage on 1890 1899 6 5.3 189.0 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc YYYY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc YYYY wholestage off 866 875 13 11.5 86.6 1.0X -date_trunc YYYY wholestage on 811 813 2 12.3 81.1 1.1X +date_trunc YYYY wholestage off 1947 1950 5 5.1 194.7 1.0X +date_trunc YYYY wholestage on 1903 1909 7 5.3 190.3 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc YY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc YY wholestage off 864 867 4 11.6 86.4 1.0X -date_trunc YY wholestage on 812 824 10 12.3 81.2 1.1X +date_trunc YY wholestage off 1941 1952 15 5.2 194.1 1.0X +date_trunc YY wholestage on 1895 1907 10 5.3 189.5 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc MON: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc MON wholestage off 881 884 4 11.3 88.1 1.0X -date_trunc MON wholestage on 820 826 7 12.2 82.0 1.1X +date_trunc MON wholestage off 1912 1934 30 5.2 191.2 1.0X +date_trunc MON wholestage on 1899 1923 20 5.3 189.9 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc MONTH: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc MONTH wholestage off 880 881 2 11.4 88.0 1.0X -date_trunc MONTH wholestage on 819 822 4 12.2 81.9 1.1X +date_trunc MONTH wholestage off 1923 1931 11 5.2 192.3 1.0X +date_trunc MONTH wholestage on 1897 1908 10 5.3 189.7 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc MM: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc MM wholestage off 889 904 21 11.2 88.9 1.0X -date_trunc MM wholestage on 818 828 8 12.2 81.8 1.1X +date_trunc MM wholestage off 1923 1924 2 5.2 192.3 1.0X +date_trunc MM wholestage on 1902 1911 10 5.3 190.2 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc DAY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc DAY wholestage off 590 593 4 16.9 59.0 1.0X -date_trunc DAY wholestage on 510 514 4 19.6 51.0 1.2X +date_trunc DAY wholestage off 1713 1717 6 5.8 171.3 1.0X +date_trunc DAY wholestage on 1693 1699 4 5.9 169.3 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc DD: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc DD wholestage off 596 604 11 16.8 59.6 1.0X -date_trunc DD wholestage on 511 519 9 19.6 51.1 1.2X +date_trunc DD wholestage off 1711 1712 1 5.8 171.1 1.0X +date_trunc DD wholestage on 1691 1697 12 5.9 169.1 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc HOUR: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc HOUR wholestage off 586 592 9 17.1 58.6 1.0X -date_trunc HOUR wholestage on 507 513 5 19.7 50.7 1.2X +date_trunc HOUR wholestage off 1715 1715 0 5.8 171.5 1.0X +date_trunc HOUR wholestage on 1699 1705 4 5.9 169.9 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc MINUTE: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc MINUTE wholestage off 561 562 1 17.8 56.1 1.0X -date_trunc MINUTE wholestage on 480 485 4 20.8 48.0 1.2X +date_trunc MINUTE wholestage off 520 524 7 19.2 52.0 1.0X +date_trunc MINUTE wholestage on 500 505 6 20.0 50.0 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc SECOND: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc SECOND wholestage off 561 561 1 17.8 56.1 1.0X -date_trunc SECOND wholestage on 479 480 2 20.9 47.9 1.2X +date_trunc SECOND wholestage off 501 502 1 20.0 50.1 1.0X +date_trunc SECOND wholestage on 497 501 3 20.1 49.7 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc WEEK: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc WEEK wholestage off 725 727 2 13.8 72.5 1.0X -date_trunc WEEK wholestage on 674 684 11 14.8 67.4 1.1X +date_trunc WEEK wholestage off 1839 1840 1 5.4 183.9 1.0X +date_trunc WEEK wholestage on 1820 1827 8 5.5 182.0 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc QUARTER: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc QUARTER wholestage off 1653 1659 10 6.1 165.3 1.0X -date_trunc QUARTER wholestage on 1588 1601 12 6.3 158.8 1.0X +date_trunc QUARTER wholestage off 2624 2624 0 3.8 262.4 1.0X +date_trunc QUARTER wholestage on 2573 2583 7 3.9 257.3 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc year: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc year wholestage off 391 393 2 25.6 39.1 1.0X -trunc year wholestage on 312 316 4 32.1 31.2 1.3X +trunc year wholestage off 315 317 3 31.8 31.5 1.0X +trunc year wholestage on 314 328 16 31.9 31.4 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc yyyy: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc yyyy wholestage off 390 394 5 25.6 39.0 1.0X -trunc yyyy wholestage on 316 319 4 31.6 31.6 1.2X +trunc yyyy wholestage off 314 317 4 31.8 31.4 1.0X +trunc yyyy wholestage on 312 315 3 32.1 31.2 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc yy: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc yy wholestage off 387 390 5 25.8 38.7 1.0X -trunc yy wholestage on 313 316 3 31.9 31.3 1.2X +trunc yy wholestage off 314 315 0 31.8 31.4 1.0X +trunc yy wholestage on 312 317 6 32.0 31.2 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc mon: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc mon wholestage off 388 395 11 25.8 38.8 1.0X -trunc mon wholestage on 314 316 2 31.8 31.4 1.2X +trunc mon wholestage off 314 315 1 31.8 31.4 1.0X +trunc mon wholestage on 310 314 4 32.2 31.0 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc month: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc month wholestage off 388 390 4 25.8 38.8 1.0X -trunc month wholestage on 315 318 2 31.7 31.5 1.2X +trunc month wholestage off 313 314 2 32.0 31.3 1.0X +trunc month wholestage on 312 316 6 32.1 31.2 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc mm: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc mm wholestage off 384 388 4 26.0 38.4 1.0X -trunc mm wholestage on 314 321 9 31.9 31.4 1.2X +trunc mm wholestage off 312 313 1 32.0 31.2 1.0X +trunc mm wholestage on 309 312 3 32.3 30.9 1.0X ================================================================================================ Parsing ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to timestamp str: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to timestamp str wholestage off 178 191 18 5.6 178.5 1.0X -to timestamp str wholestage on 157 160 2 6.4 156.6 1.1X +to timestamp str wholestage off 170 173 5 5.9 170.0 1.0X +to timestamp str wholestage on 156 161 5 6.4 155.9 1.1X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to_timestamp wholestage off 1790 1795 7 0.6 1790.0 1.0X -to_timestamp wholestage on 1813 1820 10 0.6 1813.1 1.0X +to_timestamp wholestage off 1741 1746 8 0.6 1740.7 1.0X +to_timestamp wholestage on 1887 1896 11 0.5 1886.6 0.9X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to_unix_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to_unix_timestamp wholestage off 1836 1837 1 0.5 1835.8 1.0X -to_unix_timestamp wholestage on 1786 1791 3 0.6 1785.8 1.0X +to_unix_timestamp wholestage off 1928 1934 9 0.5 1927.7 1.0X +to_unix_timestamp wholestage on 1857 1862 3 0.5 1857.5 1.0X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to date str: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to date str wholestage off 169 169 1 5.9 168.8 1.0X -to date str wholestage on 151 153 2 6.6 151.2 1.1X +to date str wholestage off 161 162 0 6.2 161.5 1.0X +to date str wholestage on 151 156 3 6.6 151.4 1.1X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to_date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to_date wholestage off 2504 2512 10 0.4 2504.4 1.0X -to_date wholestage on 2522 2536 19 0.4 2522.3 1.0X +to_date wholestage off 2513 2519 8 0.4 2513.1 1.0X +to_date wholestage on 2484 2500 15 0.4 2484.2 1.0X ================================================================================================ Conversion from/to external types ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 11.0.6+10-post-Ubuntu-1ubuntu118.04.1 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz To/from java.sql.Timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -From java.sql.Timestamp 346 367 35 14.5 69.2 1.0X -Collect longs 2139 2329 289 2.3 427.7 0.2X -Collect timestamps 1883 2086 303 2.7 376.5 0.2X +From java.sql.Timestamp 340 347 8 14.7 68.0 1.0X +Collect longs 1170 1217 42 4.3 234.1 0.3X +Collect timestamps 1771 2267 836 2.8 354.1 0.2X diff --git a/sql/core/benchmarks/DateTimeBenchmark-results.txt b/sql/core/benchmarks/DateTimeBenchmark-results.txt index 0c30534..3567a60 100644 --- a/sql/core/benchmarks/DateTimeBenchmark-results.txt +++ b/sql/core/benchmarks/DateTimeBenchmark-results.txt @@ -2,428 +2,428 @@ Extract components ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz cast to timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -cast to timestamp wholestage off 425 447 30 23.5 42.5 1.0X -cast to timestamp wholestage on 368 401 29 27.2 36.8 1.2X +cast to timestamp wholestage off 447 462 21 22.4 44.7 1.0X +cast to timestamp wholestage on 390 426 54 25.7 39.0 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz year of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -year of timestamp wholestage off 1158 1215 80 8.6 115.8 1.0X -year of timestamp wholestage on 1158 1179 31 8.6 115.8 1.0X +year of timestamp wholestage off 1189 1285 135 8.4 118.9 1.0X +year of timestamp wholestage on 1146 1156 9 8.7 114.6 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz quarter of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -quarter of timestamp wholestage off 1285 1295 15 7.8 128.5 1.0X -quarter of timestamp wholestage on 1243 1257 11 8.0 124.3 1.0X +quarter of timestamp wholestage off 1290 1293 4 7.8 129.0 1.0X +quarter of timestamp wholestage on 1237 1251 13 8.1 123.7 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz month of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -month of timestamp wholestage off 1076 1082 8 9.3 107.6 1.0X -month of timestamp wholestage on 1088 1098 9 9.2 108.8 1.0X +month of timestamp wholestage off 1096 1101 7 9.1 109.6 1.0X +month of timestamp wholestage on 1088 1095 7 9.2 108.8 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz weekofyear of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -weekofyear of timestamp wholestage off 1649 1659 14 6.1 164.9 1.0X -weekofyear of timestamp wholestage on 1648 1656 8 6.1 164.8 1.0X +weekofyear of timestamp wholestage off 1635 1636 1 6.1 163.5 1.0X +weekofyear of timestamp wholestage on 1711 1714 4 5.8 171.1 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz day of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -day of timestamp wholestage off 1083 1084 3 9.2 108.3 1.0X -day of timestamp wholestage on 1082 1089 13 9.2 108.2 1.0X +day of timestamp wholestage off 1094 1108 20 9.1 109.4 1.0X +day of timestamp wholestage on 1083 1092 8 9.2 108.3 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz dayofyear of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -dayofyear of timestamp wholestage off 1102 1103 1 9.1 110.2 1.0X -dayofyear of timestamp wholestage on 1123 1138 14 8.9 112.3 1.0X +dayofyear of timestamp wholestage off 1145 1145 1 8.7 114.5 1.0X +dayofyear of timestamp wholestage on 1131 1141 12 8.8 113.1 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz dayofmonth of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -dayofmonth of timestamp wholestage off 1068 1073 7 9.4 106.8 1.0X -dayofmonth of timestamp wholestage on 1082 1095 13 9.2 108.2 1.0X +dayofmonth of timestamp wholestage off 1112 1124 17 9.0 111.2 1.0X +dayofmonth of timestamp wholestage on 1082 1096 14 9.2 108.2 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz dayofweek of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -dayofweek of timestamp wholestage off 1265 1294 41 7.9 126.5 1.0X -dayofweek of timestamp wholestage on 1253 1262 11 8.0 125.3 1.0X +dayofweek of timestamp wholestage off 1254 1255 2 8.0 125.4 1.0X +dayofweek of timestamp wholestage on 1250 1260 10 8.0 125.0 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz weekday of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -weekday of timestamp wholestage off 1189 1191 3 8.4 118.9 1.0X -weekday of timestamp wholestage on 1193 1199 6 8.4 119.3 1.0X +weekday of timestamp wholestage off 1190 1196 8 8.4 119.0 1.0X +weekday of timestamp wholestage on 1204 1218 11 8.3 120.4 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz hour of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -hour of timestamp wholestage off 366 368 3 27.3 36.6 1.0X -hour of timestamp wholestage on 360 364 6 27.8 36.0 1.0X +hour of timestamp wholestage off 859 862 4 11.6 85.9 1.0X +hour of timestamp wholestage on 825 827 2 12.1 82.5 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz minute of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -minute of timestamp wholestage off 348 350 2 28.7 34.8 1.0X -minute of timestamp wholestage on 355 361 9 28.1 35.5 1.0X +minute of timestamp wholestage off 841 851 15 11.9 84.1 1.0X +minute of timestamp wholestage on 817 824 6 12.2 81.7 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz second of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -second of timestamp wholestage off 347 352 7 28.8 34.7 1.0X -second of timestamp wholestage on 351 359 10 28.5 35.1 1.0X +second of timestamp wholestage off 901 905 5 11.1 90.1 1.0X +second of timestamp wholestage on 830 844 12 12.1 83.0 1.1X ================================================================================================ Current date and time ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz current_date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -current_date wholestage off 284 287 4 35.2 28.4 1.0X -current_date wholestage on 312 318 6 32.1 31.2 0.9X +current_date wholestage off 290 292 2 34.4 29.0 1.0X +current_date wholestage on 301 309 10 33.3 30.1 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz current_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -current_timestamp wholestage off 291 292 2 34.4 29.1 1.0X -current_timestamp wholestage on 297 333 40 33.6 29.7 1.0X +current_timestamp wholestage off 300 301 0 33.3 30.0 1.0X +current_timestamp wholestage on 316 348 36 31.6 31.6 0.9X ================================================================================================ Date arithmetic ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz cast to date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -cast to date wholestage off 903 903 1 11.1 90.3 1.0X -cast to date wholestage on 897 900 7 11.2 89.7 1.0X +cast to date wholestage off 964 973 13 10.4 96.4 1.0X +cast to date wholestage on 900 905 4 11.1 90.0 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz last_day: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -last_day wholestage off 1082 1082 1 9.2 108.2 1.0X -last_day wholestage on 1107 1118 16 9.0 110.7 1.0X +last_day wholestage off 1125 1138 19 8.9 112.5 1.0X +last_day wholestage on 1111 1122 12 9.0 111.1 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz next_day: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -next_day wholestage off 968 974 8 10.3 96.8 1.0X -next_day wholestage on 958 959 1 10.4 95.8 1.0X +next_day wholestage off 970 982 16 10.3 97.0 1.0X +next_day wholestage on 955 958 4 10.5 95.5 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_add: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_add wholestage off 894 895 1 11.2 89.4 1.0X -date_add wholestage on 882 890 9 11.3 88.2 1.0X +date_add wholestage off 894 914 29 11.2 89.4 1.0X +date_add wholestage on 880 884 4 11.4 88.0 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_sub: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_sub wholestage off 892 896 6 11.2 89.2 1.0X -date_sub wholestage on 881 888 7 11.3 88.1 1.0X +date_sub wholestage off 901 901 1 11.1 90.1 1.0X +date_sub wholestage on 883 892 16 11.3 88.3 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz add_months: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -add_months wholestage off 1221 1223 3 8.2 122.1 1.0X -add_months wholestage on 1212 1217 5 8.2 121.2 1.0X +add_months wholestage off 1212 1213 0 8.2 121.2 1.0X +add_months wholestage on 1212 1219 11 8.3 121.2 1.0X ================================================================================================ Formatting dates ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz format date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -format date wholestage off 4989 5009 29 2.0 498.9 1.0X -format date wholestage on 5037 5055 26 2.0 503.7 1.0X +format date wholestage off 4973 5069 136 2.0 497.3 1.0X +format date wholestage on 5061 5075 18 2.0 506.1 1.0X ================================================================================================ Formatting timestamps ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz from_unixtime: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -from_unixtime wholestage off 9157 9164 10 1.1 915.7 1.0X -from_unixtime wholestage on 9101 9120 16 1.1 910.1 1.0X +from_unixtime wholestage off 8827 8835 11 1.1 882.7 1.0X +from_unixtime wholestage on 8840 8845 5 1.1 884.0 1.0X ================================================================================================ Convert timestamps ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz from_utc_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -from_utc_timestamp wholestage off 732 739 10 13.7 73.2 1.0X -from_utc_timestamp wholestage on 767 776 8 13.0 76.7 1.0X +from_utc_timestamp wholestage off 1143 1145 2 8.7 114.3 1.0X +from_utc_timestamp wholestage on 1174 1187 12 8.5 117.4 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to_utc_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to_utc_timestamp wholestage off 802 805 3 12.5 80.2 1.0X -to_utc_timestamp wholestage on 776 781 5 12.9 77.6 1.0X +to_utc_timestamp wholestage off 1721 1725 7 5.8 172.1 1.0X +to_utc_timestamp wholestage on 1605 1613 5 6.2 160.5 1.1X ================================================================================================ Intervals ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz cast interval: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -cast interval wholestage off 328 330 3 30.5 32.8 1.0X -cast interval wholestage on 319 326 7 31.3 31.9 1.0X +cast interval wholestage off 342 345 5 29.3 34.2 1.0X +cast interval wholestage on 329 336 13 30.4 32.9 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz datediff: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -datediff wholestage off 1762 1764 3 5.7 176.2 1.0X -datediff wholestage on 1495 1502 7 6.7 149.5 1.2X +datediff wholestage off 1643 1645 3 6.1 164.3 1.0X +datediff wholestage on 1645 1657 8 6.1 164.5 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz months_between: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -months_between wholestage off 1338 1339 1 7.5 133.8 1.0X -months_between wholestage on 1334 1339 5 7.5 133.4 1.0X +months_between wholestage off 3369 3375 8 3.0 336.9 1.0X +months_between wholestage on 3356 3362 5 3.0 335.6 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz window: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -window wholestage off 2023 2094 100 0.5 2023.2 1.0X -window wholestage on 43505 43551 33 0.0 43504.8 0.0X +window wholestage off 2017 2029 18 0.5 2016.8 1.0X +window wholestage on 44825 44909 56 0.0 44824.9 0.0X ================================================================================================ Truncation ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc YEAR: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc YEAR wholestage off 660 661 1 15.1 66.0 1.0X -date_trunc YEAR wholestage on 589 599 7 17.0 58.9 1.1X +date_trunc YEAR wholestage off 1628 1629 0 6.1 162.8 1.0X +date_trunc YEAR wholestage on 1589 1599 9 6.3 158.9 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc YYYY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc YYYY wholestage off 656 657 1 15.2 65.6 1.0X -date_trunc YYYY wholestage on 593 604 16 16.9 59.3 1.1X +date_trunc YYYY wholestage off 1634 1646 17 6.1 163.4 1.0X +date_trunc YYYY wholestage on 1596 1606 13 6.3 159.6 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc YY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc YY wholestage off 666 669 4 15.0 66.6 1.0X -date_trunc YY wholestage on 591 603 19 16.9 59.1 1.1X +date_trunc YY wholestage off 1627 1627 0 6.1 162.7 1.0X +date_trunc YY wholestage on 1590 1598 10 6.3 159.0 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc MON: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc MON wholestage off 592 592 1 16.9 59.2 1.0X -date_trunc MON wholestage on 569 580 8 17.6 56.9 1.0X +date_trunc MON wholestage off 1633 1634 1 6.1 163.3 1.0X +date_trunc MON wholestage on 1602 1607 5 6.2 160.2 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc MONTH: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc MONTH wholestage off 593 594 2 16.9 59.3 1.0X -date_trunc MONTH wholestage on 575 579 4 17.4 57.5 1.0X +date_trunc MONTH wholestage off 1637 1644 11 6.1 163.7 1.0X +date_trunc MONTH wholestage on 1601 1609 5 6.2 160.1 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc MM: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc MM wholestage off 589 590 2 17.0 58.9 1.0X -date_trunc MM wholestage on 569 575 4 17.6 56.9 1.0X +date_trunc MM wholestage off 1639 1653 20 6.1 163.9 1.0X +date_trunc MM wholestage on 1602 1606 4 6.2 160.2 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc DAY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc DAY wholestage off 438 442 5 22.8 43.8 1.0X -date_trunc DAY wholestage on 346 350 4 28.9 34.6 1.3X +date_trunc DAY wholestage off 1635 1643 11 6.1 163.5 1.0X +date_trunc DAY wholestage on 1511 1517 6 6.6 151.1 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc DD: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc DD wholestage off 438 439 2 22.8 43.8 1.0X -date_trunc DD wholestage on 347 354 7 28.8 34.7 1.3X +date_trunc DD wholestage off 1640 1646 8 6.1 164.0 1.0X +date_trunc DD wholestage on 1516 1519 4 6.6 151.6 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc HOUR: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc HOUR wholestage off 384 386 2 26.0 38.4 1.0X -date_trunc HOUR wholestage on 357 365 6 28.0 35.7 1.1X +date_trunc HOUR wholestage off 1533 1535 4 6.5 153.3 1.0X +date_trunc HOUR wholestage on 1532 1538 7 6.5 153.2 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc MINUTE: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc MINUTE wholestage off 373 375 3 26.8 37.3 1.0X -date_trunc MINUTE wholestage on 327 331 5 30.6 32.7 1.1X +date_trunc MINUTE wholestage off 381 382 1 26.2 38.1 1.0X +date_trunc MINUTE wholestage on 337 343 9 29.7 33.7 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc SECOND: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc SECOND wholestage off 361 363 3 27.7 36.1 1.0X -date_trunc SECOND wholestage on 335 341 8 29.9 33.5 1.1X +date_trunc SECOND wholestage off 376 376 1 26.6 37.6 1.0X +date_trunc SECOND wholestage on 341 344 6 29.4 34.1 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc WEEK: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc WEEK wholestage off 515 516 2 19.4 51.5 1.0X -date_trunc WEEK wholestage on 455 459 4 22.0 45.5 1.1X +date_trunc WEEK wholestage off 1556 1556 0 6.4 155.6 1.0X +date_trunc WEEK wholestage on 1498 1507 9 6.7 149.8 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz date_trunc QUARTER: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -date_trunc QUARTER wholestage off 1337 1341 6 7.5 133.7 1.0X -date_trunc QUARTER wholestage on 1328 1334 10 7.5 132.8 1.0X +date_trunc QUARTER wholestage off 2340 2346 9 4.3 234.0 1.0X +date_trunc QUARTER wholestage on 2309 2315 4 4.3 230.9 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc year: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc year wholestage off 318 328 14 31.4 31.8 1.0X -trunc year wholestage on 297 308 17 33.6 29.7 1.1X +trunc year wholestage off 323 323 0 31.0 32.3 1.0X +trunc year wholestage on 304 307 4 32.9 30.4 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc yyyy: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc yyyy wholestage off 318 319 2 31.5 31.8 1.0X -trunc yyyy wholestage on 296 302 10 33.8 29.6 1.1X +trunc yyyy wholestage off 323 324 2 31.0 32.3 1.0X +trunc yyyy wholestage on 303 313 12 33.0 30.3 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc yy: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc yy wholestage off 321 345 35 31.2 32.1 1.0X -trunc yy wholestage on 297 319 45 33.6 29.7 1.1X +trunc yy wholestage off 325 327 2 30.8 32.5 1.0X +trunc yy wholestage on 304 308 3 32.9 30.4 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc mon: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc mon wholestage off 318 318 0 31.5 31.8 1.0X -trunc mon wholestage on 299 306 6 33.4 29.9 1.1X +trunc mon wholestage off 327 351 34 30.5 32.7 1.0X +trunc mon wholestage on 301 302 2 33.3 30.1 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc month: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc month wholestage off 316 318 3 31.6 31.6 1.0X -trunc month wholestage on 296 301 7 33.8 29.6 1.1X +trunc month wholestage off 319 319 1 31.4 31.9 1.0X +trunc month wholestage on 301 305 4 33.2 30.1 1.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz trunc mm: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -trunc mm wholestage off 316 321 8 31.7 31.6 1.0X -trunc mm wholestage on 295 302 8 33.9 29.5 1.1X +trunc mm wholestage off 319 320 1 31.3 31.9 1.0X +trunc mm wholestage on 300 307 7 33.3 30.0 1.1X ================================================================================================ Parsing ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to timestamp str: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to timestamp str wholestage off 219 220 1 4.6 219.3 1.0X -to timestamp str wholestage on 212 214 2 4.7 212.3 1.0X +to timestamp str wholestage off 218 219 2 4.6 217.7 1.0X +to timestamp str wholestage on 212 217 5 4.7 212.4 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to_timestamp wholestage off 1852 1852 1 0.5 1851.9 1.0X -to_timestamp wholestage on 1862 1869 9 0.5 1861.6 1.0X +to_timestamp wholestage off 2063 2066 5 0.5 2062.5 1.0X +to_timestamp wholestage on 2000 2014 8 0.5 2000.3 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to_unix_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to_unix_timestamp wholestage off 1839 1842 4 0.5 1839.1 1.0X -to_unix_timestamp wholestage on 1861 1866 4 0.5 1861.2 1.0X +to_unix_timestamp wholestage off 2038 2040 4 0.5 2037.7 1.0X +to_unix_timestamp wholestage on 2021 2029 11 0.5 2020.5 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to date str: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to date str wholestage off 222 228 9 4.5 221.6 1.0X -to date str wholestage on 210 211 2 4.8 209.5 1.1X +to date str wholestage off 209 215 8 4.8 209.0 1.0X +to date str wholestage on 203 205 2 4.9 203.1 1.0X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz to_date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -to_date wholestage off 2386 2392 8 0.4 2386.3 1.0X -to_date wholestage on 2438 2457 18 0.4 2437.7 1.0X +to_date wholestage off 2191 2201 14 0.5 2191.3 1.0X +to_date wholestage on 2124 2137 16 0.5 2124.4 1.0X ================================================================================================ Conversion from/to external types ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws +OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 on Linux 4.15.0-1044-aws Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz To/from java.sql.Timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -From java.sql.Timestamp 287 291 7 17.4 57.3 1.0X -Collect longs 1903 2672 694 2.6 380.6 0.2X -Collect timestamps 1544 1644 89 3.2 308.8 0.2X +From java.sql.Timestamp 284 289 5 17.6 56.9 1.0X +Collect longs 1413 2057 930 3.5 282.6 0.2X +Collect timestamps 1605 1712 93 3.1 321.0 0.2X --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org