rdd.filter(lambda line: int(line.split(' ')[8]) >= 125)

On Fri, Oct 3, 2014 at 8:16 PM, Chop <thomrog...@att.net> wrote:
> Given an RDD  with multiple lines of the form:
>
> u'207.86.121.131 207.86.121.131 2012-11-27 13:02:17 titlestring 622592 27
> 184464'
> (fields are separated by a " ")
>
> What pyspark function/commands do I use to filter out those lines where
> line[8] >= x? (i.e line[8] >= 125)
>
> when I use line.split(" ") I get an RDD of each field in each line.
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://apache-spark-user-list.1001560.n3.nabble.com/Trouble-getting-filtering-on-field-correct-tp15728.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
> For additional commands, e-mail: user-h...@spark.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to