the-sakthi opened a new pull request, #50296:
URL: https://github.com/apache/spark/pull/50296

   ### What changes were proposed in this pull request?
   This PR adds support for extracting the minute component from TIME 
(TimeType) values in Spark SQL.
   
   ``` bash
   scala> spark.sql("SELECT minute(TIME'12:58:59');").show()
   +-------------------+
   |minute(46739000000)|
   +-------------------+
   |                 58|
   +-------------------+
   ```
   
   ### Why are the changes needed?
   - Spark previously supported minute() for only TIMESTAMP type values.
   - TIME support was missing, leading to implicit casting attempt to 
TIMESTAMP, which was incorrect.
   - This PR ensures that `minute(TIME'HH:MM:SS.######')` behaves correctly 
without unnecessary type coercion.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes
   
   - Before this PR, calling `minute(TIME'HH:MM:SS.######')` resulted in a type 
mismatch error or an implicit cast attempt to TIMESTAMP, which was incorrect.
   - With this PR, `minute(TIME'HH:MM:SS.######')` now works correctly for TIME 
values without implicit casting.
   - Users can now extract the minute component from TIME values natively.
   
   
   ### How was this patch tested?
   By running new tests:
   ```
   $ build/sbt "test:testOnly *DateExpressionsSuite"
   ```
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No
   


-- 
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

Reply via email to