DEA-C02 · Question #51
While running an external function, the following error message is received: Error: Function received the wrong number of rows What is causing this to occur?
The correct answer is D. The return message did not produce the same number of rows that it received. Option D is correct because external functions in platforms like Snowflake require the remote service to return exactly the same number of rows it received - each output row is matched back to an input row by position, so any count mismatch triggers this error. Option A is…
Question
While running an external function, the following error message is received:
Error: Function received the wrong number of rows What is causing this to occur?
Options
- AExternal functions do not support multiple rows.
- BNested arrays are not supported in the JSON response.
- CThe JSON returned by the remote service is not constructed correctly.
- DThe return message did not produce the same number of rows that it received.
How the community answered
(56 responses)- A4% (2)
- B5% (3)
- C2% (1)
- D89% (50)
Explanation
Option D is correct because external functions in platforms like Snowflake require the remote service to return exactly the same number of rows it received - each output row is matched back to an input row by position, so any count mismatch triggers this error. Option A is wrong because external functions explicitly support multiple rows in batches; that's a core use case, not a limitation. Option B is wrong because nested arrays are valid in JSON responses when structured properly, and a nesting issue would produce a different parsing error. Option C is a tempting distractor - malformed JSON does cause errors, but this specific error message points to a row count problem, not a structural JSON issue.
Memory tip: Think "rows in = rows out." The remote service acts like a 1-to-1 transformer - for every row Snowflake sends, it expects one row back. If the function filters or aggregates rows on the remote side without returning them all, this error fires.
Topics
Community Discussion
No community discussion yet for this question.