QuestionQ104

VerifiedData Processing & Transformations

A data engineer must apply custom logic to identify employees with more than 5 years of experience in the employees array column of the stores table. The custom logic must create a new exp_employees column containing, for each row, an array of every employee with more than 5 years of experience. To apply this custom logic at scale, the data engineer wants to use the FILTER higher-order function.

Which code block successfully accomplishes this task?

Explanation

The FILTER higher-order function takes an array and a Boolean lambda that is evaluated for each element. FILTER(employees, i -> i.years_exp > 5) therefore returns an array containing only employee structs whose years_exp value exceeds 5.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!