I have a programmatically generated query for BigQuery. It has part like
select *,
IF(cond1, val1, IF(cond2, val2, IF (cond3, val3, ...))) as x
But when the number of IFs grows, I start getting Fatal error: Reason: invalidQuery, message: BAD_QUERY (The query requires too many resources to parse)
I would like to know how many resources are available to parse the query and where those limits are documented. The query size itself is well under 256KB.
I didn't try yet, but wondering if rewriting query with
CASE WHEN THEN
might help here to stay under the limit.
Thank you.