a cost-based optimization engine for Apache Spark