Catalogs
Spark uses pluggable table catalogs configured via properties underspark.sql.catalog.
Catalog Types
Iceberg provides two catalog implementations:Hive Metastore Catalog
Configure a Hive-based catalog:REST Catalog
Configure a REST catalog:Hadoop Catalog
Configure a directory-based catalog:Catalog Configuration
Common configuration properties:Table Defaults and Overrides
Set default or enforced table properties:View Defaults and Overrides
Similar configuration for views:Using Catalogs
Reference tables with catalog names:Replacing the Session Catalog
Add Iceberg support to Spark’s built-in catalog:This allows using the same Hive Metastore for both Iceberg and non-Iceberg tables. Non-Iceberg tables are handled by the built-in catalog.
Catalog-Specific Hadoop Configuration
Set per-catalog Hadoop properties:Catalog-specific properties take precedence over global
spark.hadoop.* properties.Loading Custom Catalogs
Use a custom catalog implementation:SQL Extensions
Enable Iceberg SQL extensions for advanced features:CALLstored proceduresALTER TABLE ... ADD/DROP PARTITION FIELDALTER TABLE ... WRITE ORDERED BYALTER TABLE ... SET IDENTIFIER FIELDS- Branching and tagging DDL
Runtime Configuration
Configuration Precedence
Settings are applied in the following order (highest to lowest priority):- DataSource Read/Write Options -
.option(...)in code - Spark Session Configuration -
spark.conf.set(...)orspark-defaults.conf - Table Properties -
ALTER TABLE SET TBLPROPERTIES - Default Value
Spark SQL Options
Global Iceberg behaviors via Spark configuration:Common SQL Options
Read Options
Options for DataFrame reads:Write Options
Options for DataFrame writes:Commit Metadata
Add custom metadata to snapshots:Next Steps
Getting Started
Set up your first Iceberg table
Write Data
Configure write performance and distribution
Procedures
Use stored procedures for maintenance
Structured Streaming
Configure streaming reads and writes