In scala you define unboundedPreceding windows by using the minimum long value, which is -9223372036854775808L. But in SparkR, integer values are used to define long types, but the lowest integer value is only -2147483647L. Because of this, there is no way to define Window.unboundedPreceding.
This works unless the window needs more than 2.14B rows, then it will break down silently. To fix will require a commit to the RBackendHandler scala code to make a special exception for when R's minimum integer value, or another placeholder, is used.
In scala you define
unboundedPreceding
windows by using the minimum long value, which is-9223372036854775808L
. But in SparkR, integer values are used to define long types, but the lowest integer value is only-2147483647L
. Because of this, there is no way to defineWindow.unboundedPreceding
.For example, here is the function for
cumsum
:This works unless the window needs more than 2.14B rows, then it will break down silently. To fix will require a commit to the
RBackendHandler
scala code to make a special exception for when R's minimum integer value, or another placeholder, is used.