Github user viirya commented on the pull request:

    https://github.com/apache/spark/pull/11339#issuecomment-188049680
  
    This failed test:
    
        def test_reduce_by_key_and_window_with_none_invFunc(self):
            input = [range(1), range(2), range(3), range(4), range(5), range(6)]
    
            def func(dstream):
                return dstream.map(lambda x: (x, 1))\
                    .reduceByKeyAndWindow(operator.add, None, 5, 1)\
                    .filter(lambda kv: kv[1] > 0).count()
    
            expected = [[2], [4], [6], [6], [6], [6]]
            self._test_func(input, func, expected)
    
    The input should be [0], [0, 1], [0, 1, 2], [0, 1, 2, 3], [0, 1, 2, 3, 4], 
[0, 1, 2, 3, 4, 5].
    The key and value for each window and corresponding result after reduce 
func should be:
    
        window 1: [0, 1] -> [0, 1]
        window 2: [0, 1], [1, 1] -> [0, 2], [1, 1]
        window 3: [0, 1], [1, 1], [2, 1] -> [0, 3], [1, 2], [2, 1]
        window 4: [0, 1], [1, 1], [2, 1], [3, 1] -> [0, 4], [1, 3], [2, 2], [3, 
1]
        window 5: [0, 1], [1, 1], [2, 1], [3, 1], [4, 1] -> [0, 5], [1, 4], [2, 
3], [3, 2], [4, 1]
        window 6: [0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1] -> [0, 6], [1, 
5], [2, 4], [3, 3], [4, 2], [5, 1]
    
    After filter operation and count, we actually get:
    
        window 1: 1
        window 2: 2
        window 3: 3
        window 4: 4
        window 5: 5
        window 6: 6



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to