jcw024 commented on code in PR #52063:
URL: https://github.com/apache/spark/pull/52063#discussion_r2306066678
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:
##########
@@ -2747,6 +2747,8 @@ object TryMakeTimestampNTZExpressionBuilder extends
ExpressionBuilder {
0 to 60. If the sec argument equals to 60, the seconds field is
set
to 0 and 1 minute is added to the final timestamp.
* timezone - the time zone identifier. For example, CET, UTC and etc.
+ * date - a date to represent, from 0001-01-01 to 9999-12-31
+ * time - a local time to represent, from 00:00:00 to 23:59:59.999999
Review Comment:
I think this change is meant to go in the following `ExpressionDescription`
below for `TryMakeTimestampLTZExpressionBuilder`, although it is something that
will be added in https://github.com/apache/spark/pull/52062
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:
##########
@@ -2808,14 +2814,26 @@ 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].
+ MakeTimestampFromDateTime(
+ expressions(0),
+ Some(expressions(1)),
+ expressions.drop(2).lastOption
+ )
Review Comment:
should this be wrapped in `TryEval()` like it's done in
`TryMakeTimestampNTZExpressionBuilder`?
--
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]