Prerequisites and limitations for using Iceberg
To use Apache Iceberg in CDE, you'll need the following prerequisites:
- CDE Virtual Cluster with Spark 3.2.1 or higher
- CDP Private Cloud Base 7.1.7 SP2, 7.1.8, or 7.1.9
Limitations
Spark streaming is not supported when using Iceberg from Spark.
Iceberg table format version 2
Iceberg table format version 2 (v2) is available starting in Iceberg 0.14. Iceberg table format v2 uses row-level UPDATE and DELETE operations that add deleted files to encoded rows that were deleted from existing data files. The DELETE, UPDATE, and MERGE operations function by writing delete files instead of rewriting the affected data files. Additionally, upon reading the data, the encoded deletes are applied to the affected rows that are read. This functionality is called merge-on-read.
To use Iceberg table format v2, you'll need the following prerequisites:
- Iceberg 0.14
- Spark 3.2 or higher With Iceberg table format version 1 (v1), the above-mentioned operations are only supported with copy-on-write where data files are rewritten in their entirety when rows in the files are deleted. Merge-on-read is more efficient for writes, while copy-on-write is more efficient for reads.
Iceberg timestamp
- Iceberg supports two timestamp types:
- timestamp (without timezone)
- timestamptz (with timezone)
In Spark 3.3 and earlier, Spark SQL supports a single TIMESTAMP type, which maps to the Iceberg timestamptz type. However, Impala is unable to write to Iceberg tables with timestamptz columns. To create Iceberg tables from Spark with timestamp rather than timestamptz columns, set the following configurations to true:
- spark.sql.iceberg.handle-timestamp-without-timezone
- spark.sql.iceberg.use-timestamp-without-timezone-in-new-tables
Configure these properties only on Spark 3.3 and earlier.
Spark still handles the timestamp column as a timestamp with local timezone. Inconsistent results occur unless Spark is running in UTC.