Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11570#discussion_r58414690
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala ---
    @@ -36,418 +38,305 @@ import org.apache.spark.util.Utils
     object SQLConf {
     
       private val sqlConfEntries = java.util.Collections.synchronizedMap(
    -    new java.util.HashMap[String, SQLConfEntry[_]]())
    +    new java.util.HashMap[String, ConfigEntry[_]]())
     
    -  /**
    -   * An entry contains all meta information for a configuration.
    -   *
    -   * @param key the key for the configuration
    -   * @param defaultValue the default value for the configuration
    -   * @param valueConverter how to convert a string to the value. It should 
throw an exception if the
    -   *                       string does not have the required format.
    -   * @param stringConverter how to convert a value to a string that the 
user can use it as a valid
    -   *                        string value. It's usually `toString`. But 
sometimes, a custom converter
    -   *                        is necessary. E.g., if T is List[String], `a, 
b, c` is better than
    -   *                        `List(a, b, c)`.
    -   * @param doc the document for the configuration
    -   * @param isPublic if this configuration is public to the user. If it's 
`false`, this
    -   *                 configuration is only used internally and we should 
not expose it to the user.
    -   * @tparam T the value type
    -   */
    -  class SQLConfEntry[T] private(
    -      val key: String,
    -      val defaultValue: Option[T],
    -      val valueConverter: String => T,
    -      val stringConverter: T => String,
    -      val doc: String,
    -      val isPublic: Boolean) {
    -
    -    def defaultValueString: String = 
defaultValue.map(stringConverter).getOrElse("<undefined>")
    -
    -    override def toString: String = {
    -      s"SQLConfEntry(key = $key, defaultValue=$defaultValueString, 
doc=$doc, isPublic = $isPublic)"
    -    }
    +  private def register(entry: ConfigEntry[_]): Unit = 
sqlConfEntries.synchronized {
    --- End diff --
    
    It might be helpful in other places, but SQL needs to keep track of its own 
conf entries separately, so it can show them when you run "set -v", for example.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to