You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "yadavay-amzn (via GitHub)" <gi...@apache.org> on 2026/07/01 17:23:26 UTC
[PR] [SPARK-57846][SQL] Add the try_make_time function [spark]
yadavay-amzn opened a new pull request, #56932:
URL: https://github.com/apache/spark/pull/56932
### What changes were proposed in this pull request?
Adds the `try_make_time(hour, minute, second)` function, the error-safe counterpart to `make_time`: it returns the same result on valid input and `NULL` (instead of throwing) on invalid input. It is implemented as `TryEval(MakeTime(...))`, mirroring `try_make_timestamp`. Registered in the function registry, exposed via `functions.scala`, and documented (ANSI-compliance try-functions list + `sql-expression-schema`).
### Why are the changes needed?
`make_time` throws on invalid components (e.g. `hour = 25`). Users want a null-returning variant consistent with the other `try_*` datetime constructors (`try_make_timestamp`, etc.).
### Does this PR introduce _any_ user-facing change?
Yes - a new function `try_make_time`.
### How was this patch tested?
Unit tests (`TimeExpressionsSuite`), integration (`TimeFunctionsSuiteBase`), SQL-level (`time.sql`), and Connect plan-generation goldens: valid input equals `make_time`, invalid input returns `NULL`.
### Was this patch authored or co-authored using generative AI tooling?
Authored with assistance by Claude Opus 4.8.
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on PR #56932:
URL: https://github.com/apache/spark/pull/56932#issuecomment-4922081653
@MaxGekk Addressed the review comments: added a TryMakeTime wrapper so the display name is try_make_time, added the PySpark binding, fixed the doctest, and set the version to 4.3.0. Could you take another look when you get a chance?
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on code in PR #56932:
URL: https://github.com/apache/spark/pull/56932#discussion_r3587905529
##########
sql/core/src/test/scala/org/apache/spark/sql/TimeFunctionsSuiteBase.scala:
##########
@@ -164,6 +164,49 @@ abstract class TimeFunctionsSuiteBase extends SharedSparkSession {
checkAnswer(result2, expected)
}
+ test("SPARK-57846: try_make_time function") {
+ // Valid input data.
+ val schema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
+ val data = Seq(
+ Row(0, 0, BigDecimal(0.0)),
+ Row(1, 2, BigDecimal(3.4)),
+ Row(23, 59, BigDecimal(59.999999))
+ )
+ val df = spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
+
+ // Test valid inputs using both selectExpr and select.
+ val result1 = df.selectExpr("try_make_time(hour, minute, second)")
+ val result2 = df.select(try_make_time(col("hour"), col("minute"), col("second")))
+ checkAnswer(result1, result2)
+
+ val expected = Seq(
+ "00:00:00",
+ "01:02:03.4",
+ "23:59:59.999999"
+ ).toDF("timeString").select(col("timeString").cast("time"))
+ checkAnswer(result1, expected)
+
+ // Test invalid inputs return null instead of throwing.
+ val invalidSchema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
+ val invalidData = Seq(
+ Row(25, 0, BigDecimal(0.0)),
+ Row(1, 60, BigDecimal(0.0)),
+ Row(1, 2, BigDecimal(60.0))
+ )
+ val invalidDf = spark.createDataFrame(
+ spark.sparkContext.parallelize(invalidData), invalidSchema)
+ val invalidResult = invalidDf.selectExpr("try_make_time(hour, minute, second)")
+ checkAnswer(invalidResult, Seq(Row(null), Row(null), Row(null)))
+ }
+
Review Comment:
Null-input coverage for the DataFrame path lives only in the Catalyst unit test; the TimeFunctionsSuiteBase test covers valid + invalid, but not NULL columns.
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "MaxGekk (via GitHub) via reviews" <re...@spark.apache.org>.
MaxGekk commented on PR #56932:
URL: https://github.com/apache/spark/pull/56932#issuecomment-7254629732
Thank you for addressing the earlier comments, @yadavay-amzn, and sorry for the long wait. `try_make_time` and the tests look good to me now. One thing left: since `branch-4.4` has been cut, and `branch-4.x` is 4.5.0, a new function merged into master now first ships in 4.5.0, so the version marker should be 4.5.0 (rather than 4.4.0 as suggested above) in all three places:
- `since = "4.3.0"` in `timeExpressions.scala`
- `@since 4.3.0` in `sql/api/.../functions.scala`
- `.. versionadded:: 4.3.0` in `python/pyspark/sql/functions/builtin.py`
After that I'm happy to approve. Thank you!
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on code in PR #56932:
URL: https://github.com/apache/spark/pull/56932#discussion_r3587890834
##########
sql/core/src/test/scala/org/apache/spark/sql/TimeFunctionsSuiteBase.scala:
##########
@@ -164,6 +164,49 @@ abstract class TimeFunctionsSuiteBase extends SharedSparkSession {
checkAnswer(result2, expected)
}
+ test("SPARK-57846: try_make_time function") {
+ // Valid input data.
+ val schema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
+ val data = Seq(
+ Row(0, 0, BigDecimal(0.0)),
+ Row(1, 2, BigDecimal(3.4)),
+ Row(23, 59, BigDecimal(59.999999))
+ )
+ val df = spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
+
+ // Test valid inputs using both selectExpr and select.
+ val result1 = df.selectExpr("try_make_time(hour, minute, second)")
+ val result2 = df.select(try_make_time(col("hour"), col("minute"), col("second")))
+ checkAnswer(result1, result2)
+
+ val expected = Seq(
+ "00:00:00",
+ "01:02:03.4",
+ "23:59:59.999999"
+ ).toDF("timeString").select(col("timeString").cast("time"))
+ checkAnswer(result1, expected)
+
+ // Test invalid inputs return null instead of throwing.
+ val invalidSchema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
Review Comment:
This looks like a duplicate code block, please just re-use `schema`.
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on code in PR #56932:
URL: https://github.com/apache/spark/pull/56932#discussion_r3589018125
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/timeExpressions.scala:
##########
@@ -623,6 +623,57 @@ case class MakeTime(
copy(hours = newChildren(0), minutes = newChildren(1), secsAndMicros = newChildren(2))
}
+// scalastyle:off line.size.limit
+@ExpressionDescription(
+ usage = "_FUNC_(hour, minute, second) - Try to create time from hour, minute and second fields. The function returns NULL on invalid inputs.",
+ arguments = """
+ Arguments:
+ * hour - the hour to represent, from 0 to 23
+ * minute - the minute to represent, from 0 to 59
+ * second - the second to represent, from 0 to 59.999999
+ """,
+ examples = """
+ Examples:
+ > SELECT _FUNC_(6, 30, 45.887);
+ 06:30:45.887
+ > SELECT _FUNC_(NULL, 30, 0);
+ NULL
+ > SELECT _FUNC_(25, 30, 0);
+ NULL
+ """,
+ group = "datetime_funcs",
+ since = "4.3.0")
+// scalastyle:on line.size.limit
+object TryMakeTimeExpressionBuilder extends ExpressionBuilder {
+ override def build(funcName: String, expressions: Seq[Expression]): Expression = {
+ val numArgs = expressions.length
+ if (numArgs == 3) {
+ new TryMakeTime(expressions(0), expressions(1), expressions(2))
+ } else {
+ throw QueryCompilationErrors.wrongNumArgsError(funcName, Seq(3), numArgs)
Review Comment:
Yes - TimeExpressionsSuite covers it in "creating values of TimeType via try_make_time"; the invalid-input case goes through TryEval and returns null.
##########
sql/core/src/test/scala/org/apache/spark/sql/TimeFunctionsSuiteBase.scala:
##########
@@ -164,6 +164,49 @@ abstract class TimeFunctionsSuiteBase extends SharedSparkSession {
checkAnswer(result2, expected)
}
+ test("SPARK-57846: try_make_time function") {
+ // Valid input data.
+ val schema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
+ val data = Seq(
+ Row(0, 0, BigDecimal(0.0)),
+ Row(1, 2, BigDecimal(3.4)),
+ Row(23, 59, BigDecimal(59.999999))
+ )
+ val df = spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
+
+ // Test valid inputs using both selectExpr and select.
+ val result1 = df.selectExpr("try_make_time(hour, minute, second)")
+ val result2 = df.select(try_make_time(col("hour"), col("minute"), col("second")))
+ checkAnswer(result1, result2)
+
+ val expected = Seq(
+ "00:00:00",
+ "01:02:03.4",
+ "23:59:59.999999"
+ ).toDF("timeString").select(col("timeString").cast("time"))
+ checkAnswer(result1, expected)
+
+ // Test invalid inputs return null instead of throwing.
+ val invalidSchema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
Review Comment:
Done - dropped the duplicate schema and reused the existing `schema` val.
##########
sql/core/src/test/scala/org/apache/spark/sql/TimeFunctionsSuiteBase.scala:
##########
@@ -164,6 +164,49 @@ abstract class TimeFunctionsSuiteBase extends SharedSparkSession {
checkAnswer(result2, expected)
}
+ test("SPARK-57846: try_make_time function") {
+ // Valid input data.
+ val schema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
+ val data = Seq(
+ Row(0, 0, BigDecimal(0.0)),
+ Row(1, 2, BigDecimal(3.4)),
+ Row(23, 59, BigDecimal(59.999999))
+ )
+ val df = spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
+
+ // Test valid inputs using both selectExpr and select.
+ val result1 = df.selectExpr("try_make_time(hour, minute, second)")
+ val result2 = df.select(try_make_time(col("hour"), col("minute"), col("second")))
+ checkAnswer(result1, result2)
+
+ val expected = Seq(
+ "00:00:00",
+ "01:02:03.4",
+ "23:59:59.999999"
+ ).toDF("timeString").select(col("timeString").cast("time"))
+ checkAnswer(result1, expected)
+
+ // Test invalid inputs return null instead of throwing.
+ val invalidSchema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
+ val invalidData = Seq(
+ Row(25, 0, BigDecimal(0.0)),
+ Row(1, 60, BigDecimal(0.0)),
+ Row(1, 2, BigDecimal(60.0))
+ )
+ val invalidDf = spark.createDataFrame(
+ spark.sparkContext.parallelize(invalidData), invalidSchema)
+ val invalidResult = invalidDf.selectExpr("try_make_time(hour, minute, second)")
+ checkAnswer(invalidResult, Seq(Row(null), Row(null), Row(null)))
+ }
+
Review Comment:
Added a NULL-column case through the DataFrame API that asserts try_make_time returns null.
##########
sql/core/src/test/scala/org/apache/spark/sql/TimeFunctionsSuiteBase.scala:
##########
@@ -164,6 +164,49 @@ abstract class TimeFunctionsSuiteBase extends SharedSparkSession {
checkAnswer(result2, expected)
}
+ test("SPARK-57846: try_make_time function") {
+ // Valid input data.
+ val schema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
+ val data = Seq(
+ Row(0, 0, BigDecimal(0.0)),
+ Row(1, 2, BigDecimal(3.4)),
+ Row(23, 59, BigDecimal(59.999999))
+ )
+ val df = spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
+
+ // Test valid inputs using both selectExpr and select.
+ val result1 = df.selectExpr("try_make_time(hour, minute, second)")
+ val result2 = df.select(try_make_time(col("hour"), col("minute"), col("second")))
+ checkAnswer(result1, result2)
+
+ val expected = Seq(
+ "00:00:00",
+ "01:02:03.4",
+ "23:59:59.999999"
+ ).toDF("timeString").select(col("timeString").cast("time"))
+ checkAnswer(result1, expected)
Review Comment:
Switched the valid-input assertion to checkAnswer against make_time directly, matching the try_make_timestamp test.
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on code in PR #56932:
URL: https://github.com/apache/spark/pull/56932#discussion_r3587884918
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/timeExpressions.scala:
##########
@@ -623,6 +623,57 @@ case class MakeTime(
copy(hours = newChildren(0), minutes = newChildren(1), secsAndMicros = newChildren(2))
}
+// scalastyle:off line.size.limit
+@ExpressionDescription(
+ usage = "_FUNC_(hour, minute, second) - Try to create time from hour, minute and second fields. The function returns NULL on invalid inputs.",
+ arguments = """
+ Arguments:
+ * hour - the hour to represent, from 0 to 23
+ * minute - the minute to represent, from 0 to 59
+ * second - the second to represent, from 0 to 59.999999
+ """,
+ examples = """
+ Examples:
+ > SELECT _FUNC_(6, 30, 45.887);
+ 06:30:45.887
+ > SELECT _FUNC_(NULL, 30, 0);
+ NULL
+ > SELECT _FUNC_(25, 30, 0);
+ NULL
+ """,
+ group = "datetime_funcs",
+ since = "4.3.0")
+// scalastyle:on line.size.limit
+object TryMakeTimeExpressionBuilder extends ExpressionBuilder {
+ override def build(funcName: String, expressions: Seq[Expression]): Expression = {
+ val numArgs = expressions.length
+ if (numArgs == 3) {
+ new TryMakeTime(expressions(0), expressions(1), expressions(2))
+ } else {
+ throw QueryCompilationErrors.wrongNumArgsError(funcName, Seq(3), numArgs)
Review Comment:
Do we have tests for this?
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on code in PR #56932:
URL: https://github.com/apache/spark/pull/56932#discussion_r3587916057
##########
sql/core/src/test/scala/org/apache/spark/sql/TimeFunctionsSuiteBase.scala:
##########
@@ -164,6 +164,49 @@ abstract class TimeFunctionsSuiteBase extends SharedSparkSession {
checkAnswer(result2, expected)
}
+ test("SPARK-57846: try_make_time function") {
+ // Valid input data.
+ val schema = StructType(Seq(
+ StructField("hour", IntegerType, nullable = false),
+ StructField("minute", IntegerType, nullable = false),
+ StructField("second", DecimalType(16, 6), nullable = false)
+ ))
+ val data = Seq(
+ Row(0, 0, BigDecimal(0.0)),
+ Row(1, 2, BigDecimal(3.4)),
+ Row(23, 59, BigDecimal(59.999999))
+ )
+ val df = spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
+
+ // Test valid inputs using both selectExpr and select.
+ val result1 = df.selectExpr("try_make_time(hour, minute, second)")
+ val result2 = df.select(try_make_time(col("hour"), col("minute"), col("second")))
+ checkAnswer(result1, result2)
+
+ val expected = Seq(
+ "00:00:00",
+ "01:02:03.4",
+ "23:59:59.999999"
+ ).toDF("timeString").select(col("timeString").cast("time"))
+ checkAnswer(result1, expected)
Review Comment:
Note about equivalence assertion strength: the integration test compares valid output to a hardcoded string cast to time. DateFunctionsSuite.try_make_timestamp instead asserts equivalence against make_timestamp directly (checkAnswer(tryResult, makeResult) under ANSI_ENABLED=false). Doing the same here (valid rows equal make_time) would more directly express the "identical on valid input" contract.
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "yadavay-amzn (via GitHub)" <gi...@apache.org>.
yadavay-amzn commented on code in PR #56932:
URL: https://github.com/apache/spark/pull/56932#discussion_r3574749178
##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -890,6 +890,23 @@ object functions {
Column.fn("make_time", hour, minute, second)
}
+ /**
+ * Try to create time from hour, minute and second fields. The function returns NULL on invalid
+ * inputs.
+ *
+ * @param hour
+ * the hour to represent, from 0 to 23
+ * @param minute
+ * the minute to represent, from 0 to 59
+ * @param second
+ * the second to represent, from 0 to 59.999999
+ * @group datetime_funcs
+ * @since 4.1.0
Review Comment:
Done
##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -25580,6 +25580,54 @@ def make_time(hour: "ColumnOrName", minute: "ColumnOrName", second: "ColumnOrNam
return _invoke_function_over_columns("make_time", hour, minute, second)
+@_try_remote_functions
+def try_make_time(hour: "ColumnOrName", minute: "ColumnOrName", second: "ColumnOrName") -> Column:
+ """
+ Try to create time from hour, minute and second fields.
+ The function returns NULL on invalid inputs.
+
+ .. versionadded:: 4.1.0
Review Comment:
Done
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "stevomitric (via GitHub)" <gi...@apache.org>.
stevomitric commented on code in PR #56932:
URL: https://github.com/apache/spark/pull/56932#discussion_r3979098745
##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -25701,6 +25701,54 @@ def make_time(hour: "ColumnOrName", minute: "ColumnOrName", second: "ColumnOrNam
return _invoke_function_over_columns("make_time", hour, minute, second)
+@_try_remote_functions
+def try_make_time(hour: "ColumnOrName", minute: "ColumnOrName", second: "ColumnOrName") -> Column:
+ """
+ Try to create time from hour, minute and second fields.
+ The function returns NULL on invalid inputs.
+
+ .. versionadded:: 4.3.0
Review Comment:
This might be stale now (should be 4.4.0 if i'm not mistaken).
+ other places too.
--
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-57846][SQL] Add the try_make_time function [spark]
Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on code in PR #56932:
URL: https://github.com/apache/spark/pull/56932#discussion_r3982843795
##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -25701,6 +25701,54 @@ def make_time(hour: "ColumnOrName", minute: "ColumnOrName", second: "ColumnOrNam
return _invoke_function_over_columns("make_time", hour, minute, second)
+@_try_remote_functions
+def try_make_time(hour: "ColumnOrName", minute: "ColumnOrName", second: "ColumnOrName") -> Column:
+ """
+ Try to create time from hour, minute and second fields.
+ The function returns NULL on invalid inputs.
+
+ .. versionadded:: 4.3.0
Review Comment:
+1, please change to 4.4.0 @yadavay-amzn
--
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