July 2017
Intermediate to advanced
796 pages
18h 55m
English
Left outer join results in all rows from statesPopulationDF, including any common in statesPopulationDF and statesTaxRatesDF.

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