c

io.delta.tables

DeltaTableBuilder

DeltaTableBuilder 继承 AnyRef

:: 演进中 :

用于指定如何创建/替换 Delta 表的构建器。您必须在执行构建器之前指定表名或路径。您可以指定表列、分区列、数据位置、表注释和属性,以及如何创建/替换 Delta 表。

执行构建器后,将返回 DeltaTable 的实例。

使用表名创建带生成列的 Delta 表的 Scala 示例

val table: DeltaTable = DeltaTable.create()
  .tableName("testTable")
  .addColumn("c1",  dataType = "INT", nullable = false)
  .addColumn(
    DeltaTable.columnBuilder("c2")
      .dataType("INT")
      .generatedAlwaysAs("c1 + 10")
      .build()
  )
  .addColumn(
    DeltaTable.columnBuilder("c3")
      .dataType("INT")
      .comment("comment")
      .nullable(true)
      .build()
  )
  .partitionedBy("c1", "c2")
  .execute()

使用位置创建 Delta 表的 Scala 示例

val table: DeltaTable = DeltaTable.createIfNotExists(spark)
  .location("/foo/`bar`")
  .addColumn("c1", dataType = "INT", nullable = false)
  .addColumn(
    DeltaTable.columnBuilder(spark, "c2")
      .dataType("INT")
      .generatedAlwaysAs("c1 + 10")
      .build()
  )
  .addColumn(
    DeltaTable.columnBuilder(spark, "c3")
      .dataType("INT")
      .comment("comment")
      .nullable(true)
      .build()
  )
  .partitionedBy("c1", "c2")
  .execute()

替换表的 Java 示例

DeltaTable table = DeltaTable.replace()
  .tableName("db.table")
  .addColumn("c1",  "INT", false)
  .addColumn(
    DeltaTable.columnBuilder("c2")
      .dataType("INT")
      .generatedAlwaysBy("c1 + 10")
      .build()
  )
  .execute();
注解
@Evolving()

1.0.0

线性超类型
AnyRef, Any
排序
  1. 按字母顺序
  2. 按继承顺序
继承
  1. DeltaTableBuilder
  2. AnyRef
  3. Any
  1. 隐藏所有
  2. 显示所有
可见性
  1. 公共
  2. 受保护的

值成员

  1. final def !=(arg0: Any): Boolean
    定义类
    AnyRef → Any
  2. final def ##: Int
    定义类
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    定义类
    AnyRef → Any
  4. def addColumn(col: StructField): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定列。

    col

    structField 列结构

    注解
    @Evolving()

    1.0.0

  5. def addColumn(colName: String, dataType: DataType, nullable: Boolean): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定列。

    colName

    string 列名

    dataType

    dataType DDL 数据类型

    nullable

    boolean 列是否可为空

    注解
    @Evolving()

    1.0.0

  6. def addColumn(colName: String, dataType: String, nullable: Boolean): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定列。

    colName

    string 列名

    dataType

    string DDL 数据类型

    nullable

    boolean 列是否可为空

    注解
    @Evolving()

    1.0.0

  7. def addColumn(colName: String, dataType: DataType): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定列。

    colName

    string 列名

    dataType

    dataType DDL 数据类型

    注解
    @Evolving()

    1.0.0

  8. def addColumn(colName: String, dataType: String): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定列。

    colName

    string 列名

    dataType

    string DDL 数据类型

    注解
    @Evolving()

    1.0.0

  9. def addColumns(cols: StructType): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    使用现有模式指定列。

    cols

    structType 列的现有模式

    注解
    @Evolving()

    1.0.0

  10. final def asInstanceOf[T0]: T0
    定义类
    Any
  11. def clone(): AnyRef
    属性
    protected[lang]
    定义类
    AnyRef
    注解
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  12. def clusterBy(colNames: String*): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定在文件系统上对输出进行聚类的列。

    注意:这应该只包含模式中已定义的表列。

    colNames

    string* 用于聚类的列名

    注解
    @Evolving() @varargs()

    3.2.0

  13. def comment(comment: String): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定表注释以描述表。

    comment

    string 表注释

    注解
    @Evolving()

    1.0.0

  14. final def eq(arg0: AnyRef): Boolean
    定义类
    AnyRef
  15. def equals(arg0: AnyRef): Boolean
    定义类
    AnyRef → Any
  16. def execute(): DeltaTable

    :: 演进中 :

    :: 演进中 :

    执行命令以创建/替换 Delta 表并返回 DeltaTable 的实例。

    注解
    @Evolving()

    1.0.0

  17. final def getClass(): Class[_ <: AnyRef]
    定义类
    AnyRef → Any
    注解
    @IntrinsicCandidate() @native()
  18. def hashCode(): Int
    定义类
    AnyRef → Any
    注解
    @IntrinsicCandidate() @native()
  19. final def isInstanceOf[T0]: Boolean
    定义类
    Any
  20. def location(location: String): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定存储表数据的目录路径,可以是分布式存储上的路径。

    location

    string 数据位置

    注解
    @Evolving()

    1.0.0

  21. final def ne(arg0: AnyRef): Boolean
    定义类
    AnyRef
  22. final def notify(): Unit
    定义类
    AnyRef
    注解
    @IntrinsicCandidate() @native()
  23. final def notifyAll(): Unit
    定义类
    AnyRef
    注解
    @IntrinsicCandidate() @native()
  24. def partitionedBy(colNames: String*): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定在文件系统上对输出进行分区的列。

    注意:这应该只包含模式中已定义的表列。

    colNames

    string* 用于分区的列名

    注解
    @Evolving() @varargs()

    1.0.0

  25. def property(key: String, value: String): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定键值对以标记表定义。

    key

    string 表属性键

    value

    string 表属性值

    注解
    @Evolving()

    1.0.0

  26. final def synchronized[T0](arg0: => T0): T0
    定义类
    AnyRef
  27. def tableName(identifier: String): DeltaTableBuilder

    :: 演进中 :

    :: 演进中 :

    指定表名,可选地用数据库名限定 [database_name.] table_name

    identifier

    string 表名

    注解
    @Evolving()

    1.0.0

  28. def toString(): String
    定义类
    AnyRef → Any
  29. final def wait(arg0: Long, arg1: Int): Unit
    定义类
    AnyRef
    注解
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    定义类
    AnyRef
    注解
    @throws(classOf[java.lang.InterruptedException]) @native()
  31. final def wait(): Unit
    定义类
    AnyRef
    注解
    @throws(classOf[java.lang.InterruptedException])

已弃用的值成员

  1. def finalize(): Unit
    属性
    protected[lang]
    定义类
    AnyRef
    注解
    @throws(classOf[java.lang.Throwable]) @Deprecated
    已弃用

    (版本 9 起)

继承自 AnyRef

继承自 Any

未分组