spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-23060) RDD's apply function
Date Sat, 13 Jan 2018 15:26:00 GMT

    [ https://issues.apache.org/jira/browse/SPARK-23060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16325166#comment-16325166
] 

Sean Owen commented on SPARK-23060:
-----------------------------------

I see. This might otherwise be 'pipe' but that's not possible. The problem with 'apply' is
that it's usually the other way around: func.apply(arg). This works as arg.apply(func). This
just doesn't do enough useful to justify adding to this public, and older, API. It's not meaningfully
clearer to write. I would close this. 

> 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
>              Labels: features, newbie
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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


Mime
View raw message