MaxGekk commented on code in PR #45156:
URL: https://github.com/apache/spark/pull/45156#discussion_r1494082768
##########
core/src/main/scala/org/apache/spark/internal/config/ConfigBuilder.scala:
##########
@@ -111,6 +112,24 @@ private[spark] class TypedConfigBuilder[T](
}
}
+ /** Checks if the user-provided value for the config matches the validator.
+ * If it doesn't match, raise Spark's exception with the given error class.
*/
+ def checkValue(
+ validator: T => Boolean,
+ errorClass: String,
+ parameters: Map[String, String]): TypedConfigBuilder[T] = {
Review Comment:
Sorry, I didn't get how `parameters` are related to the signature of
`validator`. Just in case, here is one of examples where we would need the
`parameters`:
https://github.com/apache/spark/blob/174a19c1c0391b1084e6a0b8fdbc5c019a662b01/core/src/main/scala/org/apache/spark/internal/config/package.scala#L1128-L1131
And if you remove `parameters` how would you overload the existing one?
```scala
def checkValue(validator: T => Boolean, errorMsg: String):
TypedConfigBuilder[T] = {
```
We could "inline" the parameters to error message format, but need to
migrate all configs in one shot to:
```scala
def checkValue(validator: T => Boolean, errorClass: String):
TypedConfigBuilder[T] = {
```
--
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]