sorenmacbeth / flambo

A Clojure DSL for Apache Spark
Eclipse Public License 1.0
606 stars 84 forks source link

key-val-fn return NullPointerException when key is vector #108

Closed jiyouyou125 closed 7 years ago

jiyouyou125 commented 7 years ago

I want to get: [[a b c d1] [a b c d2] [x y z e1]] => ([a b c d1] [x y z e1])

(-> (f/parallelize sc [(ft/tuple [1 2] 1) (ft/tuple [0 1] 2)]) (f/map (ft/key-val-fn (f/fn [x y] (conj x y)))) f/collect) NullPointerException

(-> (f/parallelize sc [(ft/tuple [1 2] 1) (ft/tuple [0 1] 2)])
(f/map (f/fn [x] (let [[x1 x2] (f/untuple x)] (conj x1 x2)))) f/collect) ([1 2 1] [0 1 2])

jiyouyou125 commented 7 years ago

strange, restart nrepl , it's ok.