harshmotw-db commented on code in PR #48379:
URL: https://github.com/apache/spark/pull/48379#discussion_r1803858768
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala:
##########
@@ -700,7 +700,13 @@ case class RegExpReplace(subject: Expression, regexp:
Expression, rep: Expressio
m.region(position, source.length)
result.delete(0, result.length())
while (m.find) {
- m.appendReplacement(result, lastReplacement)
+ try {
+ m.appendReplacement(result, lastReplacement)
+ } catch {
+ case e: Exception =>
Review Comment:
I'm not 100% sure. Based on what I can see in the underlying Java file, I
think the most restrictive choice we can make is `RuntimeException` which is
just one level above `Exception`. But I still think `Exception` is the safest
choice since there might be potential errors that don't fall in the
`RuntimeExceptions` category.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]