July 2017
Intermediate to advanced
796 pages
18h 55m
English
Outer join results in all rows from statesPopulationDF and statesTaxRatesDF.

Join the two datasets by the State column as follows:
val joinDF = statesPopulationDF.join(statesTaxRatesDF, statesPopulationDF("State") === statesTaxRatesDF("State"), "fullouter")%sqlval joinDF = spark.sql("SELECT * FROM statesPopulationDF FULL OUTER JOIN statesTaxRatesDF ON statesPopulationDF.State = statesTaxRatesDF.State")scala> joinDF.countres22: Long = 351scala> joinDF.show+--------------------+----+----------+--------------------+-------+| State|Year|Population| State|TaxRate|+--------------------+----+----------+--------------------+-------+| Delaware|2010| ...Read now
Unlock full access