I am writing a map method using
RDD.map(lambda line: my_method(line))
and based on a particular condition in my_method (let's say line starts with 'a'), I want to either return a particular value otherwise ignore this item all together.
For now, I am returning -1 if the condition is not met on the item and later using another
RDD.filter() method to remove all the ones with -1.
Any better way to be able to ignore these items by returning null from my_method?