Class RuntimeConfig

Object
org.apache.spark.sql.RuntimeConfig

public abstract class RuntimeConfig extends Object
Runtime configuration interface for Spark. To access this, use SparkSession.conf.

Options set here are automatically propagated to the Hadoop configuration during I/O.

Since:
2.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    get(String key)
    Returns the value of Spark runtime configuration property for the given key.
    abstract String
    get(String key, String default_)
    Returns the value of Spark runtime configuration property for the given key.
    abstract scala.collection.immutable.Map<String,String>
    Returns all properties set in this conf.
    abstract scala.Option<String>
    Returns the value of Spark runtime configuration property for the given key.
    abstract boolean
    Indicates whether the configuration property with the given key is modifiable in the current session.
    void
    set(String key, boolean value)
    Sets the given Spark runtime configuration property.
    void
    set(String key, long value)
    Sets the given Spark runtime configuration property.
    abstract void
    set(String key, String value)
    Sets the given Spark runtime configuration property.
    abstract void
    Resets the configuration property for the given key.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RuntimeConfig

      public RuntimeConfig()
  • Method Details

    • get

      public abstract String get(String key) throws NoSuchElementException
      Returns the value of Spark runtime configuration property for the given key. If the key is not set yet, return its default value if possible, otherwise NoSuchElementException will be thrown.

      Parameters:
      key - (undocumented)
      Returns:
      (undocumented)
      Throws:
      NoSuchElementException - if the key is not set and does not have a default value
      Since:
      2.0.0
    • get

      public abstract String get(String key, String default_)
      Returns the value of Spark runtime configuration property for the given key. If the key is not set yet, return the user given default. This is useful when its default value defined by Apache Spark is not the desired one.

      Parameters:
      key - (undocumented)
      default_ - (undocumented)
      Returns:
      (undocumented)
      Since:
      2.0.0
    • getAll

      public abstract scala.collection.immutable.Map<String,String> getAll()
      Returns all properties set in this conf.

      Returns:
      (undocumented)
      Since:
      2.0.0
    • getOption

      public abstract scala.Option<String> getOption(String key)
      Returns the value of Spark runtime configuration property for the given key. If the key is not set yet, return its default value if possible, otherwise None will be returned.

      Parameters:
      key - (undocumented)
      Returns:
      (undocumented)
      Since:
      2.0.0
    • isModifiable

      public abstract boolean isModifiable(String key)
      Indicates whether the configuration property with the given key is modifiable in the current session.

      Parameters:
      key - (undocumented)
      Returns:
      true if the configuration property is modifiable. For static SQL, Spark Core, invalid (not existing) and other non-modifiable configuration properties, the returned value is false.
      Since:
      2.4.0
    • set

      public abstract void set(String key, String value)
      Sets the given Spark runtime configuration property.

      Parameters:
      key - (undocumented)
      value - (undocumented)
      Since:
      2.0.0
    • set

      public void set(String key, boolean value)
      Sets the given Spark runtime configuration property.

      Parameters:
      key - (undocumented)
      value - (undocumented)
      Since:
      2.0.0
    • set

      public void set(String key, long value)
      Sets the given Spark runtime configuration property.

      Parameters:
      key - (undocumented)
      value - (undocumented)
      Since:
      2.0.0
    • unset

      public abstract void unset(String key)
      Resets the configuration property for the given key.

      Parameters:
      key - (undocumented)
      Since:
      2.0.0