Add Spark support into Magpie