The Dataflow managed I/O connector lets you ingest real-time data into Apache Iceberg tables through a REST catalog. This approach provides low-latency streaming writes and dynamic destination routing while maintaining open table format interoperability across your lakehouse analytics stack.
Managed I/O supports multiple catalog backends, including Hadoop, Hive, and
BigQuery metastore, but this document focuses on streaming pipelines
that target a Lakehouse REST catalog. If you write to
BigQuery tables for Apache Iceberg,
use the BigQueryIO connector
with the BigQuery Storage API instead, as target tables must exist before
ingestion.
Prerequisites
Set up Lakehouse. Configure your Google Cloud project with the required permissions by following Use the Lakehouse runtime catalog with the Iceberg REST catalog. Make sure that you understand the limitations of Lakehouse Iceberg REST Catalog described on that page.
Dependencies
Add the following dependencies to your project:
Java
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-managed</artifactId>
<version>${beam.version}</version>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-io-iceberg</artifactId>
<version>${beam.version}</version>
</dependency>
<dependency>
<groupId>org.apache.iceberg</groupId>
<artifactId>iceberg-gcp</artifactId>
<version>${iceberg.version}</version>
</dependency>
Example
The following example demonstrates a streaming pipeline that writes data to an Apache Iceberg table using the REST catalog, backed by the Lakehouse runtime catalog.
Java
To authenticate to Dataflow, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
What's next
- CDC Read from Apache Iceberg with Lakehouse REST Catalog.
- Learn more about Managed I/O.
- Learn more about Lakehouse REST Catalog.