HyukjinKwon commented on code in PR #38288:
URL: https://github.com/apache/spark/pull/38288#discussion_r999155434
##########
python/pyspark/sql/functions.py:
##########
@@ -4884,6 +4884,42 @@ def check_string_field(field, fieldName): # type:
ignore[no-untyped-def]
return _invoke_function("window", time_col, windowDuration)
+def window_time(
+ windowColumn: "ColumnOrName",
+) -> Column:
+ """Computes the event time from a window column. The column window values
are produced
+ by window aggregating operators and are of type
+ StructType { start: TimestampType, end: TimestampType } where start is
inclusive and
+ end is exclusive. The event time of records produced by window aggregating
operators can be
+ computed as window_time(window) and are window.end - 1 microsecond (as
microsecond is the
+ minimal supported event time precision).
+ The window column must be one produced by a window aggregating operator -
of type
+ :class:`pyspark.sql.types.StructType`.
+ .. versionadded:: 3.4.0
+ Parameters
+ ----------
+ windowColumn : :class:`~pyspark.sql.Column`
+ The window column of a window aggregate records.
+ Returns
+ -------
+ :class:`~pyspark.sql.Column`
+ the column for computed results.
Review Comment:
```suggestion
the column for computed results.
```
--
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]