You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Nikolina Vraneš (Jira)" <ji...@apache.org> on 2026/09/15 14:23:00 UTC
[jira] [Created] (SPARK-59534) Support implicit casting for time_bucket timestamp arguments
Nikolina Vraneš created SPARK-59534:
---------------------------------------
Summary: 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
Reporter: Nikolina Vraneš
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