HyukjinKwon commented on code in PR #38288:
URL: https://github.com/apache/spark/pull/38288#discussion_r999154595
##########
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
Review Comment:
I would do something like this to make it clear: which part is code
```suggestion
computed as ``window_time(window)`` and are ``window.end -
lit(1).alias("microsecond")`` (as microsecond is the
```
--
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]