MaxGekk commented on code in PR #56354:
URL: https://github.com/apache/spark/pull/56354#discussion_r3369796423


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuiteBase.scala:
##########


Review Comment:
   Good idea -- added pre-1970 cases (`1969-12-31 23:59:59.999999789`) to the 
NTZ and LTZ narrowing tests so the floor-toward-the-past behavior for negative 
`epochMicros` is self-documented. Done in 1fcb25d.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:
##########
@@ -1838,6 +1860,9 @@ case class Cast(
             }
            """
         }
+    case TimestampType =>
+      (c, evPrim, evNull) =>
+        code"$evPrim = 
org.apache.spark.unsafe.types.TimestampNanosVal.fromParts($c, (short) 0);"

Review Comment:
   You're right, `TimestampNanosVal` is in `CodeGenerator`'s default imports, 
so the FQN isn't needed. Switched both new codegen cases to the bare name to 
match the surrounding style. Done in 1fcb25d.



-- 
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]

Reply via email to