HyukjinKwon commented on a change in pull request #29743:
URL: https://github.com/apache/spark/pull/29743#discussion_r487840749



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/TimeWindow.scala
##########
@@ -27,6 +27,28 @@ import org.apache.spark.sql.catalyst.util.IntervalUtils
 import org.apache.spark.sql.types._
 import org.apache.spark.unsafe.types.UTF8String
 
+// scalastyle:off line.size.limit
+@ExpressionDescription(
+  usage = "_FUNC_(timeColumn, windowDuration[, slideDuration[, startTime]]) - 
Create potentially overlapping time windows and create a new row for each 
window, that contains the value in `timeColumn`",
+  arguments = """
+    Arguments:
+      * timeColumn - the timestamp, that is compared with the created time 
windows
+      * windowDuration - the length of each time window
+      * slideDuration - the offset between the starts of consecutive windows
+      * startTime -
+  """,
+  examples = """
+    Examples:
+      > SELECT _FUNC_(timestamp('1970-01-01 12:00'), '10 minute', '5 minute');
+       {"start":1970-01-01 11:55:00,"end":1970-01-01 12:05:00}
+       {"start":1970-01-01 12:00:00,"end":1970-01-01 12:10:00}
+      > SELECT _FUNC_(timestamp('1970-01-01 12:00'), '10 minute', '5 minute', 
'2 minute');
+       {"start":1970-01-01 11:52:00,"end":1970-01-01 12:02:00}
+       {"start":1970-01-01 11:57:00,"end":1970-01-01 12:07:00}
+  """,
+  group = "datetime_funcs",
+  since = "2.0.0")

Review comment:
       This explicitly inherits `NonSQLExpression` unlike other functions




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to