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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to