{"record":{"id":"8b11a2034d7716de","repo":"prestodb/presto","slug":"generic-user-error-8b11a2","errorCode":"GENERIC_USER_ERROR","errorMessage":"Regexp matching interrupted","messagePattern":"Regexp matching interrupted","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/scalar/JoniRegexpFunctions.java","lineNumber":339,"sourceCode":"            offset = getMatchingOffset(matcher, nextStart, source.length());\n        } while (offset != -1);\n\n        VARCHAR.writeSlice(blockBuilder, source.slice(lastEnd, source.length() - lastEnd));\n        return blockBuilder.build();\n    }\n\n    private static int getMatchingOffset(Matcher matcher, int at, int range)\n    {\n        return getMatchingOffset(matcher, at, range, true);\n    }\n\n    private static int getMatchingOffset(Matcher matcher, int at, int range, boolean noGroups)\n    {\n        try {\n            return matcher.searchInterruptible(at, range, noGroups ? DONT_CAPTURE_GROUP : DEFAULT);\n        }\n        catch (InterruptedException interruptedException) {\n            throw new PrestoException(GENERIC_USER_ERROR, \"Regexp matching interrupted\");\n        }\n    }\n\n    private static void validateGroup(long group, Region region)\n    {\n        if (group < 0) {\n            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, \"Group cannot be negative\");\n        }\n        if (group > region.numRegs - 1) {\n            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format(\"Pattern has %d groups. Cannot access group %d\", region.numRegs - 1, group));\n        }\n    }\n}\n","sourceCodeStart":321,"sourceCodeEnd":353,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/scalar/JoniRegexpFunctions.java#L321-L353","documentation":"Internal error from getMatchingOffset: the thread performing regexp matching (searchInterruptible in regexp_extract_all/regexp_replace internals) was interrupted, typically because the query was cancelled or the coordinator timed out while a long-running regexp match was in progress.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/JoniRegexpFunctions.java:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Simplify the regexp pattern to avoid catastrophic backtracking on large inputs","Reduce the size of the scanned strings (pre-filter rows)","Re-run the query if it was cancelled externally"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}