You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2026/09/28 01:22:00 UTC

[jira] [Resolved] (SPARK-59534) Support implicit casting for time_bucket timestamp arguments

     [ https://issues.apache.org/jira/browse/SPARK-59534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon resolved SPARK-59534.
----------------------------------
    Fix Version/s: 4.4.0
       Resolution: Fixed

Issue resolved by pull request 58852
[https://github.com/apache/spark/pull/58852]

> Support implicit casting for time_bucket timestamp arguments
> ------------------------------------------------------------
>
>                 Key: SPARK-59534
>                 URL: https://issues.apache.org/jira/browse/SPARK-59534
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 5.0.0, 4.4.0
>            Reporter: Nikolina Vraneš
>            Assignee: Nikolina Vraneš
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.4.0
>
>
> Problem
> time_bucket requires TIMESTAMP or TIMESTAMP_NTZ for its timestamp and origin arguments. It rejects DATE and STRING inputs because the expression disables implicit input casting. This differs from Spark functions that declare timestamp input types and use the standard type-coercion rules.
> Proposed change
> Enable standard implicit casting for the time_bucket timestamp and origin arguments. In ANSI and legacy modes, DATE and STRING inputs cast to TIMESTAMP. Keep bucket_size strict. A STRING bucket size remains invalid because the interval input types do not accept an implicit STRING cast.
> Tests
> Add ANSI and legacy type-coercion tests. Add SQL coverage for DATE and STRING timestamp and origin arguments. Regenerate the execution and analyzer golden files.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org