I have a really large HIVE SQL query which is to be migrated over to spark.
Is there performance savings to be made by dividing up the query?
Combined:
Dataset<Row> sqlDF = spark.sql("select c.name from order o join customer c on o.orderID=c.orderID where o.productPrice > 100");
Compared to:
Dataset<Row> order = spark.sql("select o.orderID from order where where o.productPrice > 100");
Dataset<Row> customer= spark.sql("select c.orderID, c.name from customer);
Dataset<Row> joinedTable = order.join(customer, customer("orderID"));
Using Dataframes will reduce the readability but I'm not sure how spark optimizes the request.