Spark, Big Data, Processing, Data Engineering, Threads.
with the below strategy say : val join1= spark.sql("select * from tableA inner join tableB on tableA.id = tableB.id").saveAsTable("join1") val join2 = spark.sql("select * from tableC inner join tableD on tableC.id = tableD.id").saveAsTable("join2") val outPut = spark.sql("select * from join1 inner