SPLK-1004 · Question #71
What function can be used as an alternative to coalesce to return the first value from a list of fields that is not null?
The correct answer is B. case. The case function can be used as an alternative to coalesce to return the first non-null value. While coalesce(field1, field2, field3) will return the first non-null value, case(condition1, value1, condition2, value2, ...) allows more flexibility by evaluating conditions.
Question
What function can be used as an alternative to coalesce to return the first value from a list of fields that is not null?
Options
- Abin
- Bcase
- Cexact
- Dmvzip
How the community answered
(15 responses)- A7% (1)
- B87% (13)
- C7% (1)
Explanation
The case function can be used as an alternative to coalesce to return the first non-null value. While coalesce(field1, field2, field3) will return the first non-null value, case(condition1, value1, condition2, value2, ...) allows more flexibility by evaluating conditions.
Topics
Community Discussion
No community discussion yet for this question.