Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-48114][CORE] Precompile template regex to avoid unnecessary work
### What changes were proposed in this pull request? Error message template regex is now precompiled to avoid unnecessary work ### Why are the changes needed? `SparkRuntimeException` uses `SparkThrowableHelper`, which uses `ErrorClassesJsonReader` to create error message string from templates in `error-conditions.json`, but template regex is compiled on every `SparkRuntimeException` constructor invocation. This slows down error construction, in particular `UnivocityParser` + `FailureSafeParser`, where it's a hot path. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - `testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite` - Manually checked csv parsing error ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#46365 from vladimirg-db/vladimirg-db/precompile-regexes-in-error-classes-json-reader. Authored-by: Vladimir Golubev <vladimir.golubev@databricks.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
- Loading branch information