Github user huaxingao commented on a diff in the pull request:
https://github.com/apache/spark/pull/20400#discussion_r164261413
--- Diff: python/pyspark/sql/window.py ---
@@ -124,16 +124,19 @@ def rangeBetween(start, end):
values directly.
:param start: boundary start, inclusive.
- The frame is unbounded if this is
``Window.unboundedPreceding``, or
+ The frame is unbounded if this is
``Window.unboundedPreceding``,
+
``org.apache.spark.sql.catalyst.expressions.UnboundedPreceding``, or
any value less than or equal to max(-sys.maxsize,
-9223372036854775808).
:param end: boundary end, inclusive.
- The frame is unbounded if this is
``Window.unboundedFollowing``, or
+ The frame is unbounded if this is
``Window.unboundedFollowing``,
+
``org.apache.spark.sql.catalyst.expressions.UnboundedPFollowing``, or
any value greater than or equal to min(sys.maxsize,
9223372036854775807).
"""
- if start <= Window._PRECEDING_THRESHOLD:
- start = Window.unboundedPreceding
- if end >= Window._FOLLOWING_THRESHOLD:
- end = Window.unboundedFollowing
+ if isinstance(start, int) and isinstance(end, int):
--- End diff --
@HyukjinKwon @jiangxb1987
Thank you very much for your comments.
It seems to me that int and long are "unified" in python 2. I tried the
following:
```
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> value = 9223372036854775807
>>> isinstance(value, int)
True
```
It seems to me that we don't have to do long for Python 2.
I guess I will keep
```if isinstance(start, int) and isinstance(end, int)```
?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]