Github user soumitrak commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2665#discussion_r20199347
  
    --- Diff: 
streaming/src/test/java/org/apache/spark/streaming/JavaAPISuite.java ---
    @@ -1241,6 +1243,49 @@ public void testUpdateStateByKey() {
     
       @SuppressWarnings("unchecked")
       @Test
    +  public void testUpdateStateByKeyWithInitial() {
    +    List<List<Tuple2<String, Integer>>> inputData = stringIntKVStream;
    +
    +    List<Tuple2<String, Integer>> initial = Arrays.asList (
    +            new Tuple2<String, Integer> ("california", 1),
    +            new Tuple2<String, Integer> ("new york", 2));
    +
    +    JavaRDD<Tuple2<String, Integer>> tmpRDD = 
ssc.sparkContext().parallelize(initial);
    +    JavaPairRDD<String, Integer> initialRDD = JavaPairRDD.fromJavaRDD 
(tmpRDD);
    +
    +    List<List<Tuple2<String, Integer>>> expected = Arrays.asList(
    +        Arrays.asList(new Tuple2<String, Integer>("california", 5),
    +            new Tuple2<String, Integer>("new york", 7)),
    +        Arrays.asList(new Tuple2<String, Integer>("california", 15),
    +            new Tuple2<String, Integer>("new york", 11)),
    +        Arrays.asList(new Tuple2<String, Integer>("california", 15),
    +            new Tuple2<String, Integer>("new york", 11)));
    +
    +    JavaDStream<Tuple2<String, Integer>> stream = 
JavaTestUtils.attachTestInputStream(ssc, inputData, 1);
    +    JavaPairDStream<String, Integer> pairStream = 
JavaPairDStream.fromJavaDStream(stream);
    +
    +    JavaPairDStream<String, Integer> updated = pairStream.updateStateByKey(
    +        new Function2<List<Integer>, Optional<Integer>, 
Optional<Integer>>() {
    +        @Override
    --- End diff --
    
    I don't have any other change to do. Actually I copied the previous method.


---
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