uros-b commented on code in PR #56942:
URL: https://github.com/apache/spark/pull/56942#discussion_r3524933018
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/types/ops/TimestampNanosParquetOps.scala:
##########
@@ -167,3 +186,69 @@ private[ops] object TimestampNanosParquetOps {
case _ => false
})
}
+
+/**
+ * Vectorized (batch) updater for nanosecond-precision timestamps: reads an
INT64 epoch-nanos
+ * column and decomposes each value into the two-child column vector
(epochMicros: Long,
+ * nanosWithinMicro: Short). Sub-microsecond digits are truncated to the
requested precision.
+ * Mirrors the row-based `newConverter` path which calls
+ * `DateTimeUtils.epochNanosToTimestampNanos(value, precision)`.
Review Comment:
TimeVectorUpdater calls DateTimeUtils.truncateTimeToPrecision directly to
stay in lock-step with the row reader. TimestampNanosVectorUpdater inlines the
same math instead of calling DateTimeUtils.epochNanosToTimestampNanos.
The logic is equivalent today, but a shared helper would reduce drift risk
if truncation rules ever change. If object allocation is a concern, extracting
a zero-alloc (epochMicros, nanosWithinMicro) helper in DateTimeUtils would be
the cleanest fix.
--
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]