79320007

Date: 2024-12-31 12:57:19
Score: 0.5
Natty:
Report link

When you call df2.cache(), Spark begins to cache the result of the DataFrame df2, but the action to materialize this cache is still delayed until the action is executed.

The transformation pipeline is executed two times when the df2.cache() call is made and df2.show() is executed.

The correct order of executions is below: Make changes in your code:

df2.count() #Transformations will be materialized
df2.cache()
df2.show() # Now it fetches from the cached data
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (0.5):
Posted by: Srinimf