Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-7096

Java example for Streaming on site uses map instead of mapToPair

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 1.3.1
    • None
    • Documentation, Java API
    • None
    • Web

    Description

      https://spark.apache.org/docs/latest/streaming-programming-guide.html

      Here word count example for java is incorrect. It should be mapToPair instead of map.

      Incorrect:

      JavaPairDStream<String, Integer> pairs = words.map(
        new PairFunction<String, String, Integer>() {
          @Override public Tuple2<String, Integer> call(String s) throws Exception {
            return new Tuple2<String, Integer>(s, 1);
          }
        });
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ejsarge Edward Sargisson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: