This is an automated email from the ASF dual-hosted git repository.
dongjoon-hyun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 737c505c615c Revert "[SPARK-57339][SQL] Format nanosecond-precision
timestamp literals in Literal.toString and Literal.sql"
737c505c615c is described below
commit 737c505c615c15fcac125260c23b18ef9802f3b2
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Sat Jun 13 16:49:20 2026 -0700
Revert "[SPARK-57339][SQL] Format nanosecond-precision timestamp literals
in Literal.toString and Literal.sql"
This reverts commit 80e2c1c86c12b967e7bd60ca8f13c67c5265cf78.
---
.../spark/sql/catalyst/expressions/literals.scala | 27 -------
.../expressions/LiteralExpressionSuite.scala | 83 ----------------------
.../analyzer-results/timestamp-ltz-nanos.sql.out | 24 +++----
.../analyzer-results/timestamp-ntz-nanos.sql.out | 12 ++--
.../sql-tests/results/timestamp-ltz-nanos.sql.out | 24 +++----
.../sql-tests/results/timestamp-ntz-nanos.sql.out | 12 ++--
6 files changed, 36 insertions(+), 146 deletions(-)
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala
index e444929b216a..bb2001c5f12f 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala
@@ -475,12 +475,6 @@ case class Literal (value: Any, dataType: DataType)
extends LeafExpression {
TimestampFormatter.getFractionFormatter(timeZoneId).format(value.asInstanceOf[Long])
case TimestampNTZType =>
TimestampFormatter.getFractionFormatter(ZoneOffset.UTC).format(value.asInstanceOf[Long])
- case t: TimestampNTZNanosType =>
- TimestampFormatter.getFractionFormatter(ZoneOffset.UTC)
- .formatWithoutTimeZoneNanos(value.asInstanceOf[TimestampNanosVal],
t.precision)
- case t: TimestampLTZNanosType =>
- TimestampFormatter.getFractionFormatter(timeZoneId)
- .formatNanos(value.asInstanceOf[TimestampNanosVal], t.precision)
case DayTimeIntervalType(startField, endField) =>
toDayTimeIntervalString(value.asInstanceOf[Long], ANSI_STYLE,
startField, endField)
case YearMonthIntervalType(startField, endField) =>
@@ -524,8 +518,6 @@ case class Literal (value: Any, dataType: DataType) extends
LeafExpression {
case (null, _) => JNull
case (i: Int, DateType) => JString(toString)
case (l: Long, TimestampType | _: TimeType) => JString(toString)
- case (_: TimestampNanosVal, _: TimestampNTZNanosType | _:
TimestampLTZNanosType) =>
- JString(toString)
case (other, _) => JString(other.toString)
}
("value" -> jsonValue) :: ("dataType" -> dataType.jsonValue) :: Nil
@@ -577,19 +569,6 @@ case class Literal (value: Any, dataType: DataType)
extends LeafExpression {
}
}
- private def padToNanosPrecision(ts: String, precision: Int): String = {
- val dotIdx = ts.indexOf('.')
- if (dotIdx < 0) {
- ts + "." + "0" * precision
- } else {
- val fracLen = ts.length - dotIdx - 1
- // fracLen can never exceed precision:
formatNanos/formatWithoutTimeZoneNanos truncate
- // the value to `precision` digits before formatting, and the
fractionFormatter only
- // strips trailing zeros (never adds digits); the else branch handles
fracLen == precision.
- if (fracLen < precision) ts + "0" * (precision - fracLen) else ts
- }
- }
-
override def sql: String = (value, dataType) match {
case (_, NullType | _: ArrayType | _: MapType | _: StructType) if value ==
null => "NULL"
case _ if value == null => s"CAST(NULL AS ${dataType.sql})"
@@ -628,12 +607,6 @@ case class Literal (value: Any, dataType: DataType)
extends LeafExpression {
s"TIMESTAMP '$toString'"
case (v: Long, TimestampNTZType) =>
s"TIMESTAMP_NTZ '$toString'"
- // toString strips trailing zeros (display-only); pad back to exactly
`precision` digits
- // here so the SQL literal round-trips correctly through the parser.
- case (_: TimestampNanosVal, t: TimestampNTZNanosType) =>
- s"TIMESTAMP_NTZ '${padToNanosPrecision(toString, t.precision)}'"
- case (_: TimestampNanosVal, t: TimestampLTZNanosType) =>
- s"TIMESTAMP_LTZ '${padToNanosPrecision(toString, t.precision)}'"
case (i: CalendarInterval, CalendarIntervalType) =>
s"INTERVAL '${i.toString}'"
case (v: Array[Byte], BinaryType) =>
s"X'${HexFormat.of().withUpperCase().formatHex(v)}'"
diff --git
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralExpressionSuite.scala
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralExpressionSuite.scala
index b69b29f78914..7c6939eb3ad5 100644
---
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralExpressionSuite.scala
+++
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralExpressionSuite.scala
@@ -171,89 +171,6 @@ class LiteralExpressionSuite extends SparkFunSuite with
ExpressionEvalHelper {
}
}
- test("SPARK-57339: format nanosecond-precision timestamp literals in
toString and sql") {
- // UTC session timezone keeps LTZ and NTZ formatted strings identical for
the same wall-clock.
- withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> "UTC") {
- val ldt = LocalDateTime.of(2020, 1, 1, 13, 24, 35, 123456789)
- val instant = ldt.toInstant(ZoneOffset.UTC)
-
- TimestampNanosTestUtils.foreachNanosPrecision { precision =>
- val ltzType = TimestampLTZNanosType(precision)
- val ntzType = TimestampNTZNanosType(precision)
- val ltzVal = DateTimeUtils.instantToTimestampNanos(instant, precision)
- val ntzVal = DateTimeUtils.localDateTimeToTimestampNanos(ldt,
precision)
- val ltzLit = Literal(ltzVal, ltzType)
- val ntzLit = Literal(ntzVal, ntzType)
-
- // ".123456789" truncated to `precision` fractional digits (trailing
zeros stripped by
- // the FractionTimestampFormatter, but "123456789" has none for p in
[7,9]).
- val frac = ".123456789".substring(0, 1 + precision)
- val expected = s"2020-01-01 13:24:35$frac"
-
- assert(ltzLit.toString === expected, s"LTZ toString at precision
$precision")
- assert(ntzLit.toString === expected, s"NTZ toString at precision
$precision")
- assert(ltzLit.sql === s"TIMESTAMP_LTZ '$expected'",
- s"LTZ sql at precision $precision")
- assert(ntzLit.sql === s"TIMESTAMP_NTZ '$expected'",
- s"NTZ sql at precision $precision")
-
- // Round-trip: parsing the sql output must reproduce the same literal
value.
- checkEvaluation(Literal.fromSQL(ltzLit.sql), ltzVal)
- checkEvaluation(Literal.fromSQL(ntzLit.sql), ntzVal)
-
- // Trailing-zero edge: nanosWithinMicro=0 means the formatter strips
sub-micro digits.
- // sql must still emit exactly `precision` fractional digits so the
round-trip is correct.
- val zeroNanosLdt = LocalDateTime.of(2020, 1, 1, 13, 24, 35, 123456000)
- val zeroNanosInstant = zeroNanosLdt.toInstant(ZoneOffset.UTC)
- val zeroNtzVal =
DateTimeUtils.localDateTimeToTimestampNanos(zeroNanosLdt, precision)
- val zeroLtzVal =
DateTimeUtils.instantToTimestampNanos(zeroNanosInstant, precision)
- val zeroNtzLit = Literal(zeroNtzVal, ntzType)
- val zeroLtzLit = Literal(zeroLtzVal, ltzType)
-
- assert(zeroNtzLit.sql.startsWith("TIMESTAMP_NTZ '"),
- s"NTZ zero-nanos sql prefix at precision $precision")
- assert(zeroLtzLit.sql.startsWith("TIMESTAMP_LTZ '"),
- s"LTZ zero-nanos sql prefix at precision $precision")
-
- val ntzFrac = zeroNtzLit.sql.dropWhile(_ != '.').takeWhile(_ != '\'')
- val ltzFrac = zeroLtzLit.sql.dropWhile(_ != '.').takeWhile(_ != '\'')
- assert(ntzFrac.length == precision + 1,
- s"NTZ zero-nanos sql must have exactly $precision fractional digits,
got: $ntzFrac")
- assert(ltzFrac.length == precision + 1,
- s"LTZ zero-nanos sql must have exactly $precision fractional digits,
got: $ltzFrac")
-
- // toString strips trailing zeros (display-only, no padding) - same
for all precisions.
- assert(zeroNtzLit.toString === "2020-01-01 13:24:35.123456",
- s"NTZ zero-nanos toString at precision $precision (display strips
trailing zeros)")
- assert(zeroLtzLit.toString === "2020-01-01 13:24:35.123456",
- s"LTZ zero-nanos toString at precision $precision (display strips
trailing zeros)")
-
- checkEvaluation(Literal.fromSQL(zeroNtzLit.sql), zeroNtzVal)
- checkEvaluation(Literal.fromSQL(zeroLtzLit.sql), zeroLtzVal)
-
- // Whole-second edge: no fractional part at all. padToNanosPrecision
must insert
- // "." + zeros so the SQL literal carries exactly `precision`
fractional digits.
- val wholeLdt = LocalDateTime.of(2020, 1, 1, 13, 24, 35, 0)
- val wholeInstant = wholeLdt.toInstant(ZoneOffset.UTC)
- val wholeNtzVal =
DateTimeUtils.localDateTimeToTimestampNanos(wholeLdt, precision)
- val wholeLtzVal = DateTimeUtils.instantToTimestampNanos(wholeInstant,
precision)
- val wholeNtzLit = Literal(wholeNtzVal, ntzType)
- val wholeLtzLit = Literal(wholeLtzVal, ltzType)
-
- assert(wholeNtzLit.toString === "2020-01-01 13:24:35",
- s"NTZ whole-second toString at precision $precision")
- assert(wholeLtzLit.toString === "2020-01-01 13:24:35",
- s"LTZ whole-second toString at precision $precision")
- assert(wholeNtzLit.sql === s"TIMESTAMP_NTZ '2020-01-01 13:24:35.${"0"
* precision}'",
- s"NTZ whole-second sql at precision $precision")
- assert(wholeLtzLit.sql === s"TIMESTAMP_LTZ '2020-01-01 13:24:35.${"0"
* precision}'",
- s"LTZ whole-second sql at precision $precision")
- checkEvaluation(Literal.fromSQL(wholeNtzLit.sql), wholeNtzVal)
- checkEvaluation(Literal.fromSQL(wholeLtzLit.sql), wholeLtzVal)
- }
- }
- }
-
test("boolean literals") {
checkEvaluation(Literal(true), true)
checkEvaluation(Literal(false), false)
diff --git
a/sql/core/src/test/resources/sql-tests/analyzer-results/timestamp-ltz-nanos.sql.out
b/sql/core/src/test/resources/sql-tests/analyzer-results/timestamp-ltz-nanos.sql.out
index 0b46e0982e64..bbc249f3deb2 100644
---
a/sql/core/src/test/resources/sql-tests/analyzer-results/timestamp-ltz-nanos.sql.out
+++
b/sql/core/src/test/resources/sql-tests/analyzer-results/timestamp-ltz-nanos.sql.out
@@ -121,21 +121,21 @@ Project [named_struct(f, cast(null as timestamp_ltz(9)))
AS named_struct(f, CAST
-- !query
SELECT hour(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789')
-- !query analysis
-Project [hour(cast(2020-01-01 13:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS hour(TIMESTAMP_LTZ '2020-01-01
13:24:35.123456789')#x]
+Project [hour(cast(TimestampNanosVal(1577913875123456, 789) as timestamp),
Some(America/Los_Angeles)) AS hour(TimestampNanosVal(1577913875123456, 789))#x]
+- OneRowRelation
-- !query
SELECT minute(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789')
-- !query analysis
-Project [minute(cast(2020-01-01 13:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS minute(TIMESTAMP_LTZ '2020-01-01
13:24:35.123456789')#x]
+Project [minute(cast(TimestampNanosVal(1577913875123456, 789) as timestamp),
Some(America/Los_Angeles)) AS minute(TimestampNanosVal(1577913875123456,
789))#x]
+- OneRowRelation
-- !query
SELECT second(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789')
-- !query analysis
-Project [second(cast(2020-01-01 13:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS second(TIMESTAMP_LTZ '2020-01-01
13:24:35.123456789')#x]
+Project [second(cast(TimestampNanosVal(1577913875123456, 789) as timestamp),
Some(America/Los_Angeles)) AS second(TimestampNanosVal(1577913875123456,
789))#x]
+- OneRowRelation
@@ -163,63 +163,63 @@ Project [hour(cast(cast(null as timestamp_ltz(9)) as
timestamp), Some(America/Lo
-- !query
SELECT hour(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789')
-- !query analysis
-Project [hour(cast(1960-01-01 13:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS hour(TIMESTAMP_LTZ '1960-01-01
13:24:35.123456789')#x]
+Project [hour(cast(TimestampNanosVal(-315542124876544, 789) as timestamp),
Some(America/Los_Angeles)) AS hour(TimestampNanosVal(-315542124876544, 789))#x]
+- OneRowRelation
-- !query
SELECT minute(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789')
-- !query analysis
-Project [minute(cast(1960-01-01 13:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS minute(TIMESTAMP_LTZ '1960-01-01
13:24:35.123456789')#x]
+Project [minute(cast(TimestampNanosVal(-315542124876544, 789) as timestamp),
Some(America/Los_Angeles)) AS minute(TimestampNanosVal(-315542124876544,
789))#x]
+- OneRowRelation
-- !query
SELECT second(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789')
-- !query analysis
-Project [second(cast(1960-01-01 13:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS second(TIMESTAMP_LTZ '1960-01-01
13:24:35.123456789')#x]
+Project [second(cast(TimestampNanosVal(-315542124876544, 789) as timestamp),
Some(America/Los_Angeles)) AS second(TimestampNanosVal(-315542124876544,
789))#x]
+- OneRowRelation
-- !query
SELECT hour(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 Asia/Kolkata')
-- !query analysis
-Project [hour(cast(2019-12-31 23:54:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS hour(TIMESTAMP_LTZ '2019-12-31
23:54:35.123456789')#x]
+Project [hour(cast(TimestampNanosVal(1577865275123456, 789) as timestamp),
Some(America/Los_Angeles)) AS hour(TimestampNanosVal(1577865275123456, 789))#x]
+- OneRowRelation
-- !query
SELECT minute(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 Asia/Kolkata')
-- !query analysis
-Project [minute(cast(2019-12-31 23:54:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS minute(TIMESTAMP_LTZ '2019-12-31
23:54:35.123456789')#x]
+Project [minute(cast(TimestampNanosVal(1577865275123456, 789) as timestamp),
Some(America/Los_Angeles)) AS minute(TimestampNanosVal(1577865275123456,
789))#x]
+- OneRowRelation
-- !query
SELECT second(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 Asia/Kolkata')
-- !query analysis
-Project [second(cast(2019-12-31 23:54:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS second(TIMESTAMP_LTZ '2019-12-31
23:54:35.123456789')#x]
+Project [second(cast(TimestampNanosVal(1577865275123456, 789) as timestamp),
Some(America/Los_Angeles)) AS second(TimestampNanosVal(1577865275123456,
789))#x]
+- OneRowRelation
-- !query
SELECT hour(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 UTC')
-- !query analysis
-Project [hour(cast(2020-01-01 05:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS hour(TIMESTAMP_LTZ '2020-01-01
05:24:35.123456789')#x]
+Project [hour(cast(TimestampNanosVal(1577885075123456, 789) as timestamp),
Some(America/Los_Angeles)) AS hour(TimestampNanosVal(1577885075123456, 789))#x]
+- OneRowRelation
-- !query
SELECT minute(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 UTC')
-- !query analysis
-Project [minute(cast(2020-01-01 05:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS minute(TIMESTAMP_LTZ '2020-01-01
05:24:35.123456789')#x]
+Project [minute(cast(TimestampNanosVal(1577885075123456, 789) as timestamp),
Some(America/Los_Angeles)) AS minute(TimestampNanosVal(1577885075123456,
789))#x]
+- OneRowRelation
-- !query
SELECT second(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 UTC')
-- !query analysis
-Project [second(cast(2020-01-01 05:24:35.123456789 as timestamp),
Some(America/Los_Angeles)) AS second(TIMESTAMP_LTZ '2020-01-01
05:24:35.123456789')#x]
+Project [second(cast(TimestampNanosVal(1577885075123456, 789) as timestamp),
Some(America/Los_Angeles)) AS second(TimestampNanosVal(1577885075123456,
789))#x]
+- OneRowRelation
diff --git
a/sql/core/src/test/resources/sql-tests/analyzer-results/timestamp-ntz-nanos.sql.out
b/sql/core/src/test/resources/sql-tests/analyzer-results/timestamp-ntz-nanos.sql.out
index 944e5fc95c74..85192002d55e 100644
---
a/sql/core/src/test/resources/sql-tests/analyzer-results/timestamp-ntz-nanos.sql.out
+++
b/sql/core/src/test/resources/sql-tests/analyzer-results/timestamp-ntz-nanos.sql.out
@@ -121,21 +121,21 @@ Project [named_struct(f, cast(null as timestamp_ntz(9)))
AS named_struct(f, CAST
-- !query
SELECT hour(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789')
-- !query analysis
-Project [hour(cast(2020-01-01 13:24:35.123456789 as timestamp_ntz),
Some(America/Los_Angeles)) AS hour(TIMESTAMP_NTZ '2020-01-01
13:24:35.123456789')#x]
+Project [hour(cast(TimestampNanosVal(1577885075123456, 789) as timestamp_ntz),
Some(America/Los_Angeles)) AS hour(TimestampNanosVal(1577885075123456, 789))#x]
+- OneRowRelation
-- !query
SELECT minute(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789')
-- !query analysis
-Project [minute(cast(2020-01-01 13:24:35.123456789 as timestamp_ntz),
Some(America/Los_Angeles)) AS minute(TIMESTAMP_NTZ '2020-01-01
13:24:35.123456789')#x]
+Project [minute(cast(TimestampNanosVal(1577885075123456, 789) as
timestamp_ntz), Some(America/Los_Angeles)) AS
minute(TimestampNanosVal(1577885075123456, 789))#x]
+- OneRowRelation
-- !query
SELECT second(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789')
-- !query analysis
-Project [second(cast(2020-01-01 13:24:35.123456789 as timestamp_ntz),
Some(America/Los_Angeles)) AS second(TIMESTAMP_NTZ '2020-01-01
13:24:35.123456789')#x]
+Project [second(cast(TimestampNanosVal(1577885075123456, 789) as
timestamp_ntz), Some(America/Los_Angeles)) AS
second(TimestampNanosVal(1577885075123456, 789))#x]
+- OneRowRelation
@@ -163,21 +163,21 @@ Project [hour(cast(cast(null as timestamp_ntz(9)) as
timestamp_ntz), Some(Americ
-- !query
SELECT hour(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789')
-- !query analysis
-Project [hour(cast(1960-01-01 13:24:35.123456789 as timestamp_ntz),
Some(America/Los_Angeles)) AS hour(TIMESTAMP_NTZ '1960-01-01
13:24:35.123456789')#x]
+Project [hour(cast(TimestampNanosVal(-315570924876544, 789) as timestamp_ntz),
Some(America/Los_Angeles)) AS hour(TimestampNanosVal(-315570924876544, 789))#x]
+- OneRowRelation
-- !query
SELECT minute(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789')
-- !query analysis
-Project [minute(cast(1960-01-01 13:24:35.123456789 as timestamp_ntz),
Some(America/Los_Angeles)) AS minute(TIMESTAMP_NTZ '1960-01-01
13:24:35.123456789')#x]
+Project [minute(cast(TimestampNanosVal(-315570924876544, 789) as
timestamp_ntz), Some(America/Los_Angeles)) AS
minute(TimestampNanosVal(-315570924876544, 789))#x]
+- OneRowRelation
-- !query
SELECT second(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789')
-- !query analysis
-Project [second(cast(1960-01-01 13:24:35.123456789 as timestamp_ntz),
Some(America/Los_Angeles)) AS second(TIMESTAMP_NTZ '1960-01-01
13:24:35.123456789')#x]
+Project [second(cast(TimestampNanosVal(-315570924876544, 789) as
timestamp_ntz), Some(America/Los_Angeles)) AS
second(TimestampNanosVal(-315570924876544, 789))#x]
+- OneRowRelation
diff --git
a/sql/core/src/test/resources/sql-tests/results/timestamp-ltz-nanos.sql.out
b/sql/core/src/test/resources/sql-tests/results/timestamp-ltz-nanos.sql.out
index a76c750afcee..86e4459072fb 100644
--- a/sql/core/src/test/resources/sql-tests/results/timestamp-ltz-nanos.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/timestamp-ltz-nanos.sql.out
@@ -138,7 +138,7 @@ struct<named_struct(f, CAST(NULL AS
TIMESTAMP_LTZ(9))):struct<f:timestamp_ltz(9)
-- !query
SELECT hour(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789')
-- !query schema
-struct<hour(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789'):int>
+struct<hour(TimestampNanosVal(1577913875123456, 789)):int>
-- !query output
13
@@ -146,7 +146,7 @@ struct<hour(TIMESTAMP_LTZ '2020-01-01
13:24:35.123456789'):int>
-- !query
SELECT minute(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789')
-- !query schema
-struct<minute(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789'):int>
+struct<minute(TimestampNanosVal(1577913875123456, 789)):int>
-- !query output
24
@@ -154,7 +154,7 @@ struct<minute(TIMESTAMP_LTZ '2020-01-01
13:24:35.123456789'):int>
-- !query
SELECT second(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789')
-- !query schema
-struct<second(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789'):int>
+struct<second(TimestampNanosVal(1577913875123456, 789)):int>
-- !query output
35
@@ -186,7 +186,7 @@ NULL
-- !query
SELECT hour(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789')
-- !query schema
-struct<hour(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789'):int>
+struct<hour(TimestampNanosVal(-315542124876544, 789)):int>
-- !query output
13
@@ -194,7 +194,7 @@ struct<hour(TIMESTAMP_LTZ '1960-01-01
13:24:35.123456789'):int>
-- !query
SELECT minute(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789')
-- !query schema
-struct<minute(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789'):int>
+struct<minute(TimestampNanosVal(-315542124876544, 789)):int>
-- !query output
24
@@ -202,7 +202,7 @@ struct<minute(TIMESTAMP_LTZ '1960-01-01
13:24:35.123456789'):int>
-- !query
SELECT second(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789')
-- !query schema
-struct<second(TIMESTAMP_LTZ '1960-01-01 13:24:35.123456789'):int>
+struct<second(TimestampNanosVal(-315542124876544, 789)):int>
-- !query output
35
@@ -210,7 +210,7 @@ struct<second(TIMESTAMP_LTZ '1960-01-01
13:24:35.123456789'):int>
-- !query
SELECT hour(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 Asia/Kolkata')
-- !query schema
-struct<hour(TIMESTAMP_LTZ '2019-12-31 23:54:35.123456789'):int>
+struct<hour(TimestampNanosVal(1577865275123456, 789)):int>
-- !query output
23
@@ -218,7 +218,7 @@ struct<hour(TIMESTAMP_LTZ '2019-12-31
23:54:35.123456789'):int>
-- !query
SELECT minute(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 Asia/Kolkata')
-- !query schema
-struct<minute(TIMESTAMP_LTZ '2019-12-31 23:54:35.123456789'):int>
+struct<minute(TimestampNanosVal(1577865275123456, 789)):int>
-- !query output
54
@@ -226,7 +226,7 @@ struct<minute(TIMESTAMP_LTZ '2019-12-31
23:54:35.123456789'):int>
-- !query
SELECT second(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 Asia/Kolkata')
-- !query schema
-struct<second(TIMESTAMP_LTZ '2019-12-31 23:54:35.123456789'):int>
+struct<second(TimestampNanosVal(1577865275123456, 789)):int>
-- !query output
35
@@ -234,7 +234,7 @@ struct<second(TIMESTAMP_LTZ '2019-12-31
23:54:35.123456789'):int>
-- !query
SELECT hour(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 UTC')
-- !query schema
-struct<hour(TIMESTAMP_LTZ '2020-01-01 05:24:35.123456789'):int>
+struct<hour(TimestampNanosVal(1577885075123456, 789)):int>
-- !query output
5
@@ -242,7 +242,7 @@ struct<hour(TIMESTAMP_LTZ '2020-01-01
05:24:35.123456789'):int>
-- !query
SELECT minute(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 UTC')
-- !query schema
-struct<minute(TIMESTAMP_LTZ '2020-01-01 05:24:35.123456789'):int>
+struct<minute(TimestampNanosVal(1577885075123456, 789)):int>
-- !query output
24
@@ -250,7 +250,7 @@ struct<minute(TIMESTAMP_LTZ '2020-01-01
05:24:35.123456789'):int>
-- !query
SELECT second(TIMESTAMP_LTZ '2020-01-01 13:24:35.123456789 UTC')
-- !query schema
-struct<second(TIMESTAMP_LTZ '2020-01-01 05:24:35.123456789'):int>
+struct<second(TimestampNanosVal(1577885075123456, 789)):int>
-- !query output
35
diff --git
a/sql/core/src/test/resources/sql-tests/results/timestamp-ntz-nanos.sql.out
b/sql/core/src/test/resources/sql-tests/results/timestamp-ntz-nanos.sql.out
index e6827c1abf63..c1aa8b2c2ffb 100644
--- a/sql/core/src/test/resources/sql-tests/results/timestamp-ntz-nanos.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/timestamp-ntz-nanos.sql.out
@@ -138,7 +138,7 @@ struct<named_struct(f, CAST(NULL AS
TIMESTAMP_NTZ(9))):struct<f:timestamp_ntz(9)
-- !query
SELECT hour(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789')
-- !query schema
-struct<hour(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789'):int>
+struct<hour(TimestampNanosVal(1577885075123456, 789)):int>
-- !query output
13
@@ -146,7 +146,7 @@ struct<hour(TIMESTAMP_NTZ '2020-01-01
13:24:35.123456789'):int>
-- !query
SELECT minute(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789')
-- !query schema
-struct<minute(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789'):int>
+struct<minute(TimestampNanosVal(1577885075123456, 789)):int>
-- !query output
24
@@ -154,7 +154,7 @@ struct<minute(TIMESTAMP_NTZ '2020-01-01
13:24:35.123456789'):int>
-- !query
SELECT second(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789')
-- !query schema
-struct<second(TIMESTAMP_NTZ '2020-01-01 13:24:35.123456789'):int>
+struct<second(TimestampNanosVal(1577885075123456, 789)):int>
-- !query output
35
@@ -186,7 +186,7 @@ NULL
-- !query
SELECT hour(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789')
-- !query schema
-struct<hour(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789'):int>
+struct<hour(TimestampNanosVal(-315570924876544, 789)):int>
-- !query output
13
@@ -194,7 +194,7 @@ struct<hour(TIMESTAMP_NTZ '1960-01-01
13:24:35.123456789'):int>
-- !query
SELECT minute(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789')
-- !query schema
-struct<minute(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789'):int>
+struct<minute(TimestampNanosVal(-315570924876544, 789)):int>
-- !query output
24
@@ -202,7 +202,7 @@ struct<minute(TIMESTAMP_NTZ '1960-01-01
13:24:35.123456789'):int>
-- !query
SELECT second(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789')
-- !query schema
-struct<second(TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789'):int>
+struct<second(TimestampNanosVal(-315570924876544, 789)):int>
-- !query output
35
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]