Step 2 - Register both DataFrames as temp tables to make querying easier

To register both datasets, we can use the following code:

ratingsDF.createOrReplaceTempView("ratings")
moviesDF.createOrReplaceTempView("movies")

This will help to make in-memory querying faster by creating a temporary view as a table in the memory. The lifetime of the temporary table using the createOrReplaceTempView () method is tied to [[SparkSession]], which was used to create this DataFrame.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset