cloud-fan commented on a change in pull request #33588:
URL: https://github.com/apache/spark/pull/33588#discussion_r751210215
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcSerializer.scala
##########
@@ -148,6 +150,16 @@ class OrcSerializer(dataSchema: StructType) {
result.setNanos(ts.getNanos)
result
+ case TimestampNTZType => (getter, ordinal) =>
+ val micros = getter.getLong(ordinal)
+ val seconds = Math.floorDiv(micros, MICROS_PER_SECOND)
+ val ts = new Timestamp(seconds * MILLIS_PER_SECOND)
+ val nanos = (micros - seconds * MICROS_PER_SECOND) * NANOS_PER_MICROS
+ ts.setNanos(nanos.toInt)
+ val result = new OrcTimestamp(ts.getTime)
+ result.setNanos(ts.getNanos)
Review comment:
ditto, `OrcUtils.toOrcNTZ`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]