10 views
What are transformation and action in Spark?
Asked at
AI answer
In Spark, a transformation is a lazy transformation of the source dataset, such as filter, select, or map. It describes computations but usually doesn’t run them immediately. An action starts execution of the plan and returns a result or writes it, for example count(), collect(), show(), or write. Spark builds a plan from transformations and optimizes and executes it when an action is called. For example: df.filter("age >= 18").count() — filter is a transformation, and count is an action.
Also asked at RWB (Wildberries & Russ)
- What tasks did you perform at [company] and what did you manage to achieve during your time there?
- How to view the execution plan of an SQL query?
- Why are you considering leaving [company] and what is important to you in a new offer?
- Why did you leave [organization] and join [company]?
- What is your comfortable salary expectation level?