uros-db commented on code in PR #52063:
URL: https://github.com/apache/spark/pull/52063#discussion_r2430048262
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:
##########
@@ -2808,14 +2814,27 @@ object MakeTimestampLTZExpressionBuilder extends
ExpressionBuilder {
NULL
> SELECT _FUNC_(2024, 13, 22, 15, 30, 0);
NULL
+ > SELECT _FUNC_(DATE'2014-12-28', TIME'6:30:45.887');
+ 2014-12-28 06:30:45.887
+ > SELECT _FUNC_(DATE'2014-12-28', TIME'6:30:45.887', 'CET');
+ 2014-12-27 21:30:45.887
""",
group = "datetime_funcs",
since = "4.0.0")
// scalastyle:on line.size.limit
object TryMakeTimestampLTZExpressionBuilder extends ExpressionBuilder {
override def build(funcName: String, expressions: Seq[Expression]):
Expression = {
val numArgs = expressions.length
- if (numArgs == 6 || numArgs == 7) {
+ if (numArgs == 2 || numArgs == 3) {
+ // Overload for: date, time[, timezone].
+ TryEval(
+ MakeTimestampFromDateTime(
Review Comment:
I don't think we have to do that here, because invalid date/time here would
throw parse exceptions before that point anyways (both in ANSI and non-ANSI).
In this sense, it's a different kind of situation compared to integer
construction (year, month, day, hour, min) of `MakeTimestamp` below for example.
--
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]