uros-db commented on code in PR #51575: URL: https://github.com/apache/spark/pull/51575#discussion_r2223854597
########## sql/api/src/main/scala/org/apache/spark/sql/functions.scala: ########## @@ -5731,6 +5764,39 @@ object functions { */ def to_timestamp(s: Column, fmt: String): Column = Column.fn("to_timestamp", s, lit(fmt)) + /** + * Parses a string value to a time value. + * + * @param str + * A string to be parsed to time Review Comment: Same as https://github.com/apache/spark/pull/51575/files/a38b76dce876b8464ed30b582791ed966e84b5b6#r2223270557. ########## sql/api/src/main/scala/org/apache/spark/sql/functions.scala: ########## @@ -5731,6 +5764,39 @@ object functions { */ def to_timestamp(s: Column, fmt: String): Column = Column.fn("to_timestamp", s, lit(fmt)) + /** + * Parses a string value to a time value. + * + * @param str + * A string to be parsed to time + * @return + * A time, or null if the input is malformed. + * @group datetime_funcs + * @since 4.1.0 + */ + def try_to_time(str: Column): Column = { + Column.fn("try_to_time", str) + } + + /** + * Parses a string value to a time value. + * + * See <a href="https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html"> Datetime + * Patterns</a> for valid time format patterns. + * + * @param str + * A string to be parsed to time Review Comment: Same as https://github.com/apache/spark/pull/51575/files/a38b76dce876b8464ed30b582791ed966e84b5b6#r2223270557. ########## sql/api/src/main/scala/org/apache/spark/sql/functions.scala: ########## @@ -5731,6 +5764,39 @@ object functions { */ def to_timestamp(s: Column, fmt: String): Column = Column.fn("to_timestamp", s, lit(fmt)) + /** + * Parses a string value to a time value. + * + * @param str + * A string to be parsed to time + * @return + * A time, or null if the input is malformed. + * @group datetime_funcs + * @since 4.1.0 + */ + def try_to_time(str: Column): Column = { + Column.fn("try_to_time", str) + } + + /** + * Parses a string value to a time value. + * + * See <a href="https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html"> Datetime + * Patterns</a> for valid time format patterns. + * + * @param str + * A string to be parsed to time + * @param format + * Time format pattern to follow Review Comment: Same as https://github.com/apache/spark/pull/51575/files/a38b76dce876b8464ed30b582791ed966e84b5b6#r2223270557. -- 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