You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2024/02/19 04:24:52 UTC

Re: [PR] [SPARK-47087][SQL] Raise Spark's exception with an error class in config value check [spark]

cloud-fan commented on code in PR #45156:
URL: https://github.com/apache/spark/pull/45156#discussion_r1493993228


##########
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:
   do we need this parameter? Looking at the signature of `validator`, `T => Boolean`, I don't think a config definition can provide extra parameters.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org