[ https://issues.apache.org/jira/browse/SPARK-23060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16325110#comment-16325110 ]
Hyukjin Kwon commented on SPARK-23060: -------------------------------------- [~gianmarco.donetti], I think you refer Pandas's pipe - https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.pipe.html? I don't think it's worth adding it, for now. I think we have avoided to add such APIs in my experience. > 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-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org