Packages

o

org.apache.spark.sql.catalyst.util

ResolveDefaultColumns

object ResolveDefaultColumns

This object contains fields to help process DEFAULT columns.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ResolveDefaultColumns
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val CURRENT_DEFAULT_COLUMN_METADATA_KEY: String
  5. val CURRENT_DEFAULT_COLUMN_NAME: String
  6. val EXISTS_DEFAULT_COLUMN_METADATA_KEY: String
  7. def analyze(colName: String, dataType: DataType, defaultSQL: String, statementType: String): Expression

    Parses and analyzes the DEFAULT column SQL string, returning an error upon failure.

    Parses and analyzes the DEFAULT column SQL string, returning an error upon failure.

    returns

    Result of the analysis and constant-folding operation.

  8. def analyze(field: StructField, statementType: String, metadataKey: String = CURRENT_DEFAULT_COLUMN_METADATA_KEY): Expression

    Parses and analyzes the DEFAULT column text in field, returning an error upon failure.

    Parses and analyzes the DEFAULT column text in field, returning an error upon failure.

    field

    represents the DEFAULT column value whose "default" metadata to parse and analyze.

    statementType

    which type of statement we are running, such as INSERT; useful for errors.

    metadataKey

    which key to look up from the column metadata; generally either CURRENT_DEFAULT_COLUMN_METADATA_KEY or EXISTS_DEFAULT_COLUMN_METADATA_KEY.

    returns

    Result of the analysis and constant-folding operation.

  9. def applyExistenceDefaultValuesToRow(schema: StructType, row: InternalRow): Unit

    Updates a subset of columns in the row with default values from the metadata in the schema.

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  12. def constantFoldCurrentDefaultsToExistDefaults(tableSchema: StructType, statementType: String): StructType

    Finds "current default" expressions in CREATE/REPLACE TABLE columns and constant-folds them.

    Finds "current default" expressions in CREATE/REPLACE TABLE columns and constant-folds them.

    The results are stored in the "exists default" metadata of the same columns. For example, in the event of this statement:

    CREATE TABLE T(a INT, b INT DEFAULT 5 + 5)

    This method constant-folds the "current default" value, stored in the CURRENT_DEFAULT metadata of the "b" column, to "10", storing the result in the "exists default" value within the EXISTS_DEFAULT metadata of that same column. Meanwhile the "current default" metadata of this "b" column retains its original value of "5 + 5".

    The reason for constant-folding the EXISTS_DEFAULT is to make the end-user visible behavior the same, after executing an ALTER TABLE ADD COLUMNS command with DEFAULT value, as if the system had performed an exhaustive backfill of the provided value to all previously existing rows in the table instead. We choose to avoid doing such a backfill because it would be a time-consuming and costly operation. Instead, we elect to store the EXISTS_DEFAULT in the column metadata for future reference when querying data out of the data source. In turn, each data source then takes responsibility to provide the constant-folded value in the EXISTS_DEFAULT metadata for such columns where the value is not present in storage.

    tableSchema

    represents the names and types of the columns of the statement to process.

    statementType

    name of the statement being processed, such as INSERT; useful for errors.

    returns

    a copy of tableSchema with field metadata updated with the constant-folded values.

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def getDescribeMetadata(schema: StructType): Seq[(String, String, String)]

    If any fields in a schema have default values, appends them to the result.

  18. def getExistenceDefaultValues(schema: StructType): Array[Any]

    Parses the text representing constant-folded default column literal values.

    Parses the text representing constant-folded default column literal values. These are known as "existence" default values because each one is the constant-folded result of the original default value first assigned to the column at table/column creation time. When scanning a field from any data source, if the corresponding value is not present in storage, the output row returns this "existence" default value instead of NULL.

    returns

    a sequence of either (1) NULL, if the column had no default value, or (2) an object of Any type suitable for assigning into a row using the InternalRow.update method.

  19. def getExistenceDefaultsBitmask(schema: StructType): Array[Boolean]

    Returns an array of boolean values equal in size to the result of getExistenceDefaultValues above, for convenience.

  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. def normalizeFieldName(str: String): String

    Normalizes a schema field name suitable for use in looking up into maps keyed by schema field names.

    Normalizes a schema field name suitable for use in looking up into maps keyed by schema field names.

    str

    the field name to normalize

    returns

    the normalized result

  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def resetExistenceDefaultsBitmask(schema: StructType): Unit

    Resets the elements of the array initially returned from getExistenceDefaultsBitmask above.

    Resets the elements of the array initially returned from getExistenceDefaultsBitmask above. Afterwards, set element(s) to false before calling applyExistenceDefaultValuesToRow below.

  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. def validateCatalogForDefaultValue(schema: StructType, catalog: TableCatalog, ident: Identifier): Unit
  30. def validateTableProviderForDefaultValue(schema: StructType, tableProvider: Option[String], statementType: String, addNewColumnToExistingTable: Boolean): Unit
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  34. object BuiltInFunctionCatalog extends FunctionCatalog

    This is a FunctionCatalog for performing analysis using built-in functions only.

    This is a FunctionCatalog for performing analysis using built-in functions only. It is a helper for the DefaultColumnAnalyzer above.

  35. object DefaultColumnAnalyzer extends Analyzer

    This is an Analyzer for processing default column values using built-in functions only.

Inherited from AnyRef

Inherited from Any

Ungrouped