Hi All, Thank you very much for the detailed explanation.
I have scenario like this- I have rdd of ticket records and another rdd of booking records. for each ticket record, i need to check whether any link exists in booking table. val ticketCachedRdd = ticketRdd.cache ticketRdd.foreach{ ticket => val bookingRecords = queryOnBookingTable (date, flightNumber, flightCarrier) // this function queries the booking table and retrieves the booking rows println(ticketCachedRdd.count) // this is throwing Null pointer exception } Is there somthing wrong in the count, i am trying to use the count of cached rdd when looping through the actual rdd. whats wrong in this ? Thanks, Padma Ch