hvanhovell commented on code in PR #47464:
URL: https://github.com/apache/spark/pull/47464#discussion_r1693954290
##########
connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -1893,33 +1855,6 @@ class SparkConnectPlanner(
val unit = extractString(children(0), "unit")
Some(TimestampAdd(unit, children(1), children(2)))
- case "window" if Seq(2, 3, 4).contains(fun.getArgumentsCount) =>
- val children = fun.getArgumentsList.asScala.map(transformExpression)
- val timeCol = children.head
- val windowDuration = extractString(children(1), "windowDuration")
- var slideDuration = windowDuration
- if (fun.getArgumentsCount >= 3) {
- slideDuration = extractString(children(2), "slideDuration")
- }
- var startTime = "0 second"
- if (fun.getArgumentsCount == 4) {
- startTime = extractString(children(3), "startTime")
- }
- Some(
- Alias(TimeWindow(timeCol, windowDuration, slideDuration, startTime),
"window")(
- nonInheritableMetadataKeys = Seq(Dataset.DATASET_ID_KEY,
Dataset.COL_POS_KEY)))
-
- case "session_window" if fun.getArgumentsCount == 2 =>
- val children = fun.getArgumentsList.asScala.map(transformExpression)
- val timeCol = children.head
- val sessionWindow = children.last match {
- case Literal(s, StringType) if s != null => SessionWindow(timeCol,
s.toString)
- case other => SessionWindow(timeCol, other)
- }
- Some(
- Alias(sessionWindow, "session_window")(nonInheritableMetadataKeys =
Review Comment:
Ah ok, that makes sense.
--
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]