This topic describes how to convert a Parquet table in Hive or Spark SQL to a Delta table.

Examples:
  • Scala
    import io.delta.tables. _
    // Convert a non-partitioned table to a Delta table.
    val deltaTable = DeltaTable.convertToDelta(spark, "parquet.`/path/to/table`")
    // Convert a partitioned table to a Delta table.
    val partitionedDeltaTable = DeltaTable.convertToDelta(spark, "parquet.`/path/to/table`", "date string")
  • SQL
    -- Convert a non-partitioned table to a Delta table.
    CONVERT TO DELTA parquet_table;
    -- Convert a partitioned table to a Delta table.
    CONVERT TO DELTA parquet_table PARTITIONED BY (date STRING);