zhengruifeng commented on code in PR #51831:
URL: https://github.com/apache/spark/pull/51831#discussion_r2377342814
##########
python/pyspark/sql/connect/functions/builtin.py:
##########
@@ -4043,9 +4089,43 @@ def try_make_timestamp_ntz(
mins: "ColumnOrName",
secs: "ColumnOrName",
) -> Column:
- return _invoke_function_over_columns(
- "try_make_timestamp_ntz", years, months, days, hours, mins, secs
- )
+ ...
+
+
+@overload
+def try_make_timestamp_ntz(
+ *,
+ date: "ColumnOrName",
+ time: "ColumnOrName",
+) -> Column:
+ ...
+
+
+def try_make_timestamp_ntz(
+ years: Optional["ColumnOrName"] = None,
+ months: Optional["ColumnOrName"] = None,
+ days: Optional["ColumnOrName"] = None,
+ hours: Optional["ColumnOrName"] = None,
+ mins: Optional["ColumnOrName"] = None,
+ secs: Optional["ColumnOrName"] = None,
+ *,
+ date: Optional["ColumnOrName"] = None,
+ time: Optional["ColumnOrName"] = None,
+) -> Column:
+ if years is not None:
+ _years = years
+ _months = lit(0) if months is None else months
+ _days = lit(0) if days is None else days
+ _hours = lit(0) if hours is None else hours
+ _mins = lit(0) if mins is None else mins
+ _secs = lit(0) if secs is None else secs
Review Comment:
why support None => lit(0) here?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]