viirya commented on PR #44480: URL: https://github.com/apache/spark/pull/44480#issuecomment-1869303202
> Apache Spark explicitly requires Timezone information for these kind of conversions. > > https://github.com/apache/spark/blob/bb85bbcf16f7c837a47d0cf430bc94899709c254/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala#L269-L275 > > So, is the proposal to ignore the timezone for the foldable values? For the `Cast` in optimization stage, it must be resolved and the condition of resolved one for timestamp conversion is that timezone information is available: ```scala override lazy val resolved: Boolean = childrenResolved && checkInputDataTypes().isSuccess && (!needsTimeZone || timeZoneId.isDefined) ``` -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org