Spark 1857 improve error message when trying perform a spark operation inside another spark operation

This is a quick little PR that should improve error message when trying perform a spark operation inside another spark operation. Its implemented by adding a getPartitioner function to check if the partitioner is null and adding the same check to the existing sparkContext function on RDDs.