You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "the-sakthi (via GitHub)" <gi...@apache.org> on 2025/04/10 00:50:46 UTC

[PR] [SPARK-51420][SQL][FOLLOWUP] Support all valid TIME precisions in the minute function [spark]

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

   ### What changes were proposed in this pull request?
   - Extend the minute(...) function (MinutesOfTime) to handle TIME types of any precision from 0 to 6.
   - Add tests verifying that minute(...) works for all valid TIME precisions.
   
   
   ### 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?
   <!--
   If generative AI tooling has been used in the process of authoring this patch, please include the
   phrase: 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   


-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-51420][SQL][FOLLOWUP] Support all valid TIME precisions in the minute function [spark]

Posted by "the-sakthi (via GitHub)" <gi...@apache.org>.
the-sakthi commented on PR #50551:
URL: https://github.com/apache/spark/pull/50551#issuecomment-2796366776

   Thank you very much, @MaxGekk !


-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-51420][SQL][FOLLOWUP] Support all valid TIME precisions in the minute function [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk closed pull request #50551: [SPARK-51420][SQL][FOLLOWUP] Support all valid TIME precisions in the minute function
URL: https://github.com/apache/spark/pull/50551


-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-51420][SQL][FOLLOWUP] Support all valid TIME precisions in the minute function [spark]

Posted by "the-sakthi (via GitHub)" <gi...@apache.org>.
the-sakthi commented on PR #50551:
URL: https://github.com/apache/spark/pull/50551#issuecomment-2791282031

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


-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-51420][SQL][FOLLOWUP] Support all valid TIME precisions in the minute function [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #50551:
URL: https://github.com/apache/spark/pull/50551#issuecomment-2796352636

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


-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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