You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Gianmarco Donetti (JIRA)" <ji...@apache.org> on 2018/01/12 16:26:00 UTC

[jira] [Created] (SPARK-23060) RDD's apply function

Gianmarco Donetti created SPARK-23060:
-----------------------------------------

             Summary: RDD's apply function
                 Key: SPARK-23060
                 URL: https://issues.apache.org/jira/browse/SPARK-23060
             Project: Spark
          Issue Type: New Feature
          Components: PySpark
    Affects Versions: 2.2.1
            Reporter: Gianmarco Donetti
            Priority: Minor


New function for RDDs -> apply

        >>> def foo(rdd):
        ...     return rdd.map(lambda x: x.split('|')).filter(lambda x: x[0] == 'ERROR')
        >>> rdd = sc.parallelize(['ERROR|10', 'ERROR|12', 'WARNING|10', 'INFO|2'])
        >>> result = rdd.apply(foo)
        >>> result.collect()
        [('ERROR', '10'), ('ERROR', '12')]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org