Use Apache Beam and SpannerIO to connect to Spanner Omni
Stay organized with collections
Save and categorize content based on your preferences.
Apache Beam is an open source, unified model for
defining both batch and streaming data-parallel processing pipelines. This
document describes how to use the SpannerIO connector within an
Apache Beam pipeline to read from or write to Spanner Omni
databases.
Before you begin
To connect SpannerIO to Spanner Omni, ensure that
you meet the following requirements:
Initialize a database within your Spanner Omni environment.
Use Apache Beam release 2.69.0 or later.
Set up authentication credentials for your environment.
Configure SpannerIO to connect to Spanner Omni
To connect SpannerIO to Spanner Omni, you must
configure the SpannerConfig with your database details and connection
parameters. Note that SpannerIO supports only plain-text
communications when connecting to Spanner Omni.
To configure the connection, do the following:
Specify the Spanner Omni database instance and endpoint.
Enable experimental host support using the withExperimentalHost method.
Configure the pipeline to use a plain-text channel.
The following example shows how to create a SpannerConfig object for
Spanner Omni:
SpannerConfigspannerConfig=SpannerConfig.create().withDatabaseId("DATABASE_ID")// Define the Spanner Omni endpoint.withExperimentalHost("http://ENDPOINT")// SpannerIO supports only plain-text connections.withUsingPlainTextChannel(true);
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-04-22 UTC."],[],[]]