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

Some comments for `updateStateByKey` are wrong

    XMLWordPrintableJSON

    Details

    • Type: Documentation
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.2.0, 1.3.0
    • Component/s: DStreams
    • Labels:
      None

      Description

      The following `updateStateByKey` overloads have wrong description for `updateFunc`

        /**
         * @param updateFunc State update function. If `this` function returns None, then
         *                   corresponding state key-value pair will be eliminated. Note, that
         *                   this function may generate a different a tuple with a different key
         *                   than the input key. It is up to the developer to decide whether to
         *                   remember the partitioner despite the key being changed.
         */
        def updateStateByKey[S: ClassTag](
            updateFunc: (Iterator[(K, Seq[V], Option[S])]) => Iterator[(K, S)],
            partitioner: Partitioner,
            rememberPartitioner: Boolean
          ): DStream[(K, S)]
      
        /**
         * @param updateFunc State update function. If `this` function returns None, then
         *                   corresponding state key-value pair will be eliminated. Note, that
         *                   this function may generate a different a tuple with a different key
         *                   than the input key. It is up to the developer to decide whether to
         *                   remember the partitioner despite the key being changed.
         */
        def updateStateByKey[S: ClassTag](
            updateFunc: (Iterator[(K, Seq[V], Option[S])]) => Iterator[(K, S)],
            partitioner: Partitioner,
            rememberPartitioner: Boolean,
            initialRDD: RDD[(K, S)]
          ): DStream[(K, S)]
      

      ` If `this` function returns None, then corresponding state key-value pair will be eliminated.` should be removed.

        Attachments

          Activity

            People

            • Assignee:
              zsxwing Shixiong Zhu
              Reporter:
              zsxwing Shixiong Zhu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: