Elazar Gershuni created SPARK-12623:
---------------------------------------

             Summary: map key_values to values
                 Key: SPARK-12623
                 URL: https://issues.apache.org/jira/browse/SPARK-12623
             Project: Spark
          Issue Type: New Feature
          Components: Spark Core
            Reporter: Elazar Gershuni
            Priority: Minor


Why doesn't the argument to mapValues() take a key as an agument? 
Alternatively, can we have a "mapKeyValuesToValues" that does?

Use case: I want to write a simpler analyzer that takes the argument to map(), 
and analyze it to see whether it (trivially) doesn't change the key, e.g. 
g = lambda kv: (kv[0], f(kv[0], kv[1])
rdd.map(g)

Problem is, if I find that it is the case, I can't call mapValues() with that 
function, as in `rdd.mapValues(lambda kv: g(kv)[1])`, since mapValues receives 
only `v` as an argument.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to