Skip to content

Commit 3f777e1

Browse files
committed
invFunc=none work properly with python's reduceByKeyAndWindow
1 parent d925149 commit 3f777e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/pyspark/streaming/dstream.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ def reduceByKeyAndWindow(self, func, invFunc, windowDuration, slideDuration=None
524524
`invFunc` can be None, then it will reduce all the RDDs in window, could be slower
525525
than having `invFunc`.
526526
527-
@param reduceFunc: associative reduce function
528-
@param invReduceFunc: inverse function of `reduceFunc`
527+
@param func: associative reduce function
528+
@param invFunc: inverse function of `reduceFunc`
529529
@param windowDuration: width of the window; must be a multiple of this DStream's
530530
batching interval
531531
@param slideDuration: sliding interval of the window (i.e., the interval after which
@@ -556,7 +556,7 @@ def invReduceFunc(t, a, b):
556556
if kv[1] is not None else kv[0])
557557

558558
jreduceFunc = TransformFunction(self._sc, reduceFunc, reduced._jrdd_deserializer)
559-
if invReduceFunc:
559+
if invFunc:
560560
jinvReduceFunc = TransformFunction(self._sc, invReduceFunc, reduced._jrdd_deserializer)
561561
else:
562562
jinvReduceFunc = None

0 commit comments

Comments
 (0)