Followup: Error: Failed to parse regular expression “”: pattern too large - compile failed

StackOverflow https://stackoverflow.com/questions/23323237

  •  10-07-2023
  •  | 
  •  

문제

This is a followup on Error: Failed to parse regular expression "": pattern too large - compile failed...

I am hitting this problem again.

Can anyone please please explain how BigQuery allocates resources for REGEXP functions? Is there a known issue (and ways to avoid it) of "too many"\"too complex" REGEXP expressions in a single BQ query?

Many Thanks

도움이 되었습니까?

해결책

Regular expression parsing has some unfortunate corner cases that can eat up a lot of processing cycles (see http://www.regular-expressions.info/catastrophic.html). The regular expression state machines can also eat up a lot of memory. Because of this, BigQuery has a budget for regular expressions. The current value is something like 2MB per query. This is a guideline, not a published guarantee, however, and is subject to change at any time.

BigQuery is documented to use Re2 (code here: https://code.google.com/p/re2/) for regular expression parsing; You can try running your regular expressions with this library using a budget of 2MB and check whether they succeed or not.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top