You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "vranes (via GitHub)" <gi...@apache.org> on 2026/09/23 19:28:10 UTC
Re: [PR] [SPARK-59534][SQL] Support implicit casting of DATE and STRING to TIMESTAMP in time_bucket [spark]
vranes commented on code in PR #58852:
URL: https://github.com/apache/spark/pull/58852#discussion_r4086417103
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:
##########
@@ -5199,7 +5199,7 @@ case class TimeBucket(
ts: Expression,
originTs: Expression,
timeZoneId: Option[String] = None)
- extends TernaryExpression with ExpectsInputTypes with TimeZoneAwareExpression {
+ extends TernaryExpression with ImplicitCastInputTypes with TimeZoneAwareExpression {
Review Comment:
I ran the tests, it turns out string bucket sizes are not implicitly cast in either mode. The expected width type is a TypeCollection of abstract interval constraints, so ANSI’s String-to-AtomicType case does not apply. I decided to keep the applicable width coercion, including untyped NULL, and added ANSI and legacy tests for string rejection and NULL coercion.
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org