Skip to content

Commit

Permalink
Add spanner host param to Spanner CSV export template.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 350634680
  • Loading branch information
allenpradeep authored and cloud-teleport committed Jan 7, 2021
1 parent ca0d47e commit 2843755
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public static void main(String[] args) {

SpannerConfig spannerConfig =
SpannerConfig.create()
.withHost(options.getSpannerHost())
.withProjectId(options.getSpannerProjectId())
.withInstanceId(options.getSpannerInstanceId())
.withDatabaseId(options.getSpannerDatabaseId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.apache.beam.sdk.io.gcp.spanner.ExposedSpannerAccessor;
import org.apache.beam.sdk.io.gcp.spanner.ReadOperation;
import org.apache.beam.sdk.io.gcp.spanner.SpannerConfig;
import org.apache.beam.sdk.options.Default;
import org.apache.beam.sdk.options.Description;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.ValueProvider;
Expand Down Expand Up @@ -93,6 +94,13 @@ public interface SpannerReadOptions extends PipelineOptions {

@SuppressWarnings("unused")
void setSpannerDatabaseId(ValueProvider<String> spannerDatabaseId);

@Description("Spanner host")
@Default.String("https://batch-spanner.googleapis.com")
ValueProvider<String> getSpannerHost();

@SuppressWarnings("unused")
void setSpannerHost(ValueProvider<String> value);
}

/** Factory for Export transform class. */
Expand Down

0 comments on commit 2843755

Please sign in to comment.