cloud-fan commented on a change in pull request #34984:
URL: https://github.com/apache/spark/pull/34984#discussion_r778851718
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcDeserializer.scala
##########
@@ -127,10 +127,16 @@ class OrcDeserializer(
updater.setInt(ordinal, OrcShimUtils.getGregorianDays(value))
case TimestampType => (ordinal, value) =>
- updater.setLong(ordinal,
DateTimeUtils.fromJavaTimestamp(value.asInstanceOf[OrcTimestamp]))
-
- case TimestampNTZType => (ordinal, value) =>
- updater.setLong(ordinal,
OrcUtils.fromOrcNTZ(value.asInstanceOf[OrcTimestamp]))
+ // When reading as Spark LTZ, the ORC value can be either
`OrcTimestamp`
+ // (which maps to Spark LTZ) or `LongWritable` (which maps to Spark
NTZ)
+ if (value.isInstanceOf[OrcTimestamp]) {
+ // Spark takes Orc timestamp as timestampLTZ, so read it as the
Timestamp.
Review comment:
we don't need the comments inside if-else now
--
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]