Learning to write Spark examples