Skip to content

Conversation

@the-sakthi
Copy link
Member

@the-sakthi the-sakthi commented Apr 10, 2025

What changes were proposed in this pull request?

Why are the changes needed?

  • Previously, minute(...) did not consistently support TIME type inputs with arbitrary precision.
  • Users need the minute function to handle TIME(0) through TIME(6).

Does this PR introduce any user-facing change?

  • Yes. Users can now call minute(...) on TIME(p) columns or literals with any valid precision.

How was this patch tested?

By running new tests:

$ build/sbt "test:testOnly *TimeExpressionsSuite.scala"

By manual tests:

scala> spark.sql("select minute(cast('12:30' as time(0)));").show()
+------------------------------+
|minute(CAST(12:30 AS TIME(0)))|
+------------------------------+
|                            30|
+------------------------------+


scala> spark.sql("select minute(cast('12:30' as time(2)));").show()
+------------------------------+
|minute(CAST(12:30 AS TIME(2)))|
+------------------------------+
|                            30|
+------------------------------+


scala> spark.sql("select minute(cast('12:30' as time(5)));").show()
+------------------------------+
|minute(CAST(12:30 AS TIME(5)))|
+------------------------------+
|                            30|
+------------------------------+

Was this patch authored or co-authored using generative AI tooling?

No

@the-sakthi
Copy link
Member Author

the-sakthi commented Apr 10, 2025

@MaxGekk This should fix the concern on the original PR. Let me know.

@MaxGekk
Copy link
Member

MaxGekk commented Apr 11, 2025

+1, LGTM. Merging to master.
Thank you, @the-sakthi.

@the-sakthi
Copy link
Member Author

Thank you very much, @MaxGekk !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants