error recovery and Spark embedding