     ;; JavaDStream doesn't have a .reduceByKey so cast to JavaPairDStream first
     (-> dstream
       (.mapToPair (pair-function identity))
-      (.reduceByKey (function2 f))
-      (.map (function f/untuple)))
+      (.reduceByKey (function2 f)))
     ;; if it's already JavaPairDStream, we're good
     (-> dstream
-        (.reduceByKey (function2 f))
-        (.map (function f/untuple)))))
+        (.reduceByKey (function2 f)))))
 
 (defn map-to-pair [dstream f]
   (.mapToPair dstream (pair-function f)))

                                     function
                                     function2
                                     pair-function
                                     void-function]])
  (:import [org.apache.spark.streaming.api.java JavaStreamingContext JavaDStream]
           [org.apache.spark.streaming.kafka KafkaUtils]
           [org.apache.spark.streaming.flume FlumeUtils]

(defn group-by-key-and-window [dstream window-length slide-interval]
  (-> dstream
      (.mapToPair (pair-function identity))
      (.groupByKeyAndWindow (duration window-length) (duration slide-interval))))

(defn reduce-by-window [dstream f f-inv window-length slide-interval]
  (.reduceByWindow dstream (function2 f) (function2 f-inv) (duration window-length) (duration slide-interval)))
