object DeltaTable extends Serializable

Companion object to create DeltaTable instances.

DeltaTable.forPath(sparkSession, pathToTheDeltaTable)
Since

0.3.0

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DeltaTable
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def Evolving API columnBuilder(spark: SparkSession, colName: String): DeltaColumnBuilder

    Return an instance of DeltaColumnBuilder to specify a column. Refer to DeltaTableBuilder for examples and DeltaColumnBuilder detailed APIs.

    spark

    sparkSession sparkSession passed by the user

    colName

    string the column name

    Annotations
    @Evolving()
    Since

    1.0.0

  2. def Evolving API columnBuilder(colName: String): DeltaColumnBuilder

    Return an instance of DeltaColumnBuilder to specify a column. Refer to DeltaTableBuilder for examples and DeltaColumnBuilder detailed APIs.

    Note: This uses the active SparkSession in the current thread to read the table data. Hence, this throws error if active SparkSession has not been set, that is, SparkSession.getActiveSession() is empty.

    colName

    string the column name

    Annotations
    @Evolving()
    Since

    1.0.0

  3. def convertToDelta(spark: SparkSession, identifier: String): DeltaTable

    Create a DeltaTable from the given parquet table.

    Create a DeltaTable from the given parquet table. Takes an existing parquet table and constructs a delta transaction log in the base path of the table.

    Note: Any changes to the table during the conversion process may not result in a consistent state at the end of the conversion. Users should stop any changes to the table before the conversion is started.

    An Example would be

    io.delta.tables.DeltaTable.convertToDelta(
     spark,
     "parquet.`/path`"
    Since

    0.4.0

  4. def convertToDelta(spark: SparkSession, identifier: String, partitionSchema: String): DeltaTable

    Create a DeltaTable from the given parquet table and partition schema.

    Create a DeltaTable from the given parquet table and partition schema. Takes an existing parquet table and constructs a delta transaction log in the base path of that table.

    Note: Any changes to the table during the conversion process may not result in a consistent state at the end of the conversion. Users should stop any changes to the table before the conversion is started.

    An example usage would be

    io.delta.tables.DeltaTable.convertToDelta(
     spark,
     "parquet.`/path`",
     "key1 long, key2 string")
    Since

    0.4.0

  5. def convertToDelta(spark: SparkSession, identifier: String, partitionSchema: StructType): DeltaTable

    Create a DeltaTable from the given parquet table and partition schema.

    Create a DeltaTable from the given parquet table and partition schema. Takes an existing parquet table and constructs a delta transaction log in the base path of that table.

    Note: Any changes to the table during the conversion process may not result in a consistent state at the end of the conversion. Users should stop any changes to the table before the conversion is started.

    An example usage would be

    io.delta.tables.DeltaTable.convertToDelta(
     spark,
     "parquet.`/path`",
     new StructType().add(StructField("key1", LongType)).add(StructField("key2", StringType)))
    Since

    0.4.0

  6. def Evolving API create(spark: SparkSession): DeltaTableBuilder

    Return an instance of DeltaTableBuilder to create a Delta table, error if the table exists (the same as SQL CREATE TABLE). Refer to DeltaTableBuilder for more details.

    spark

    sparkSession sparkSession passed by the user

    Annotations
    @Evolving()
    Since

    1.0.0

  7. def Evolving API create(): DeltaTableBuilder

    Return an instance of DeltaTableBuilder to create a Delta table, error if the table exists (the same as SQL CREATE TABLE). Refer to DeltaTableBuilder for more details.

    Note: This uses the active SparkSession in the current thread to read the table data. Hence, this throws error if active SparkSession has not been set, that is, SparkSession.getActiveSession() is empty.

    Annotations
    @Evolving()
    Since

    1.0.0

  8. def Evolving API createIfNotExists(spark: SparkSession): DeltaTableBuilder

    Return an instance of DeltaTableBuilder to create a Delta table, if it does not exists (the same as SQL CREATE TABLE IF NOT EXISTS). Refer to DeltaTableBuilder for more details.

    spark

    sparkSession sparkSession passed by the user

    Annotations
    @Evolving()
    Since

    1.0.0

  9. def Evolving API createIfNotExists(): DeltaTableBuilder

    Return an instance of DeltaTableBuilder to create a Delta table, if it does not exists (the same as SQL CREATE TABLE IF NOT EXISTS). Refer to DeltaTableBuilder for more details.

    Note: This uses the active SparkSession in the current thread to read the table data. Hence, this throws error if active SparkSession has not been set, that is, SparkSession.getActiveSession() is empty.

    Annotations
    @Evolving()
    Since

    1.0.0

  10. def Evolving API createOrReplace(spark: SparkSession): DeltaTableBuilder

    Return an instance of DeltaTableBuilder to replace a Delta table, or create table if not exists (the same as SQL CREATE OR REPLACE TABLE) Refer to DeltaTableBuilder for more details.

    spark

    sparkSession sparkSession passed by the user.

    Annotations
    @Evolving()
    Since

    1.0.0

  11. def Evolving API createOrReplace(): DeltaTableBuilder

    Return an instance of DeltaTableBuilder to replace a Delta table or create table if not exists (the same as SQL CREATE OR REPLACE TABLE) Refer to DeltaTableBuilder for more details.

    Note: This uses the active SparkSession in the current thread to read the table data. Hence, this throws error if active SparkSession has not been set, that is, SparkSession.getActiveSession() is empty.

    Annotations
    @Evolving()
    Since

    1.0.0

  12. def forName(sparkSession: SparkSession, tableName: String): DeltaTable

    Create a DeltaTable using the given table or view name using the given SparkSession.

  13. def forName(tableOrViewName: String): DeltaTable

    Create a DeltaTable using the given table or view name using the given SparkSession.

    Create a DeltaTable using the given table or view name using the given SparkSession.

    Note: This uses the active SparkSession in the current thread to read the table data. Hence, this throws error if active SparkSession has not been set, that is, SparkSession.getActiveSession() is empty.

  14. def forPath(sparkSession: SparkSession, path: String): DeltaTable

    Create a DeltaTable for the data at the given path using the given SparkSession.

    Create a DeltaTable for the data at the given path using the given SparkSession.

    Since

    0.3.0

  15. def forPath(path: String): DeltaTable

    Create a DeltaTable for the data at the given path.

    Create a DeltaTable for the data at the given path.

    Note: This uses the active SparkSession in the current thread to read the table data. Hence, this throws error if active SparkSession has not been set, that is, SparkSession.getActiveSession() is empty.

    Since

    0.3.0

  16. def isDeltaTable(identifier: String): Boolean

    Check if the provided identifier string, in this case a file path, is the root of a Delta table.

    Check if the provided identifier string, in this case a file path, is the root of a Delta table.

    Note: This uses the active SparkSession in the current thread to search for the table. Hence, this throws error if active SparkSession has not been set, that is, SparkSession.getActiveSession() is empty.

    An example would be

    DeltaTable.isDeltaTable(spark, "/path/to/table")
    Since

    0.4.0

  17. def isDeltaTable(sparkSession: SparkSession, identifier: String): Boolean

    Check if the provided identifier string, in this case a file path, is the root of a Delta table using the given SparkSession.

    Check if the provided identifier string, in this case a file path, is the root of a Delta table using the given SparkSession.

    An example would be

    DeltaTable.isDeltaTable(spark, "path/to/table")
    Since

    0.4.0

  18. def Evolving API replace(spark: SparkSession): DeltaTableBuilder

    Return an instance of DeltaTableBuilder to replace a Delta table, error if the table doesn't exist (the same as SQL REPLACE TABLE) Refer to DeltaTableBuilder for more details.

    spark

    sparkSession sparkSession passed by the user

    Annotations
    @Evolving()
    Since

    1.0.0

  19. def Evolving API replace(): DeltaTableBuilder

    Return an instance of DeltaTableBuilder to replace a Delta table, error if the table doesn't exist (the same as SQL REPLACE TABLE) Refer to DeltaTableBuilder for more details.

    Note: This uses the active SparkSession in the current thread to read the table data. Hence, this throws error if active SparkSession has not been set, that is, SparkSession.getActiveSession() is empty.

    Annotations
    @Evolving()
    Since

    1.0.0