You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "wattache (via GitHub)" <gi...@apache.org> on 2024/09/27 07:18:58 UTC
Re: [PR] Allow setting BigQuery endpoint [beam]
wattache commented on PR #32153:
URL: https://github.com/apache/beam/pull/32153#issuecomment-2378580478
Hello,
Thank you for this new feature. May I ask you @kberezin-nshl how you intend the user to use this new possibilities ?
I've tried to use test container for my pipeline, but I still get the error message `"The project test-project has not enabled BigQuery.",` with url being `https://bigquery.googleapis.com/bigquery/v2/projects/test-project/datasets/***/tables/***/insertAll?prettyPrint=false`
I use TestContainer and TestPipeline
```java
BigQueryEmulatorContainer container = new BigQueryEmulatorContainer("ghcr.io/goccy/bigquery-emulator:0.4.3");
String projectId = container.getProjectId();
org.apache.beam.sdk.io.gcp.bigquery.BigQueryOptions pipelineOptions = PipelineOptionsFactory.create().as(org.apache.beam.sdk.io.gcp.bigquery.BigQueryOptions.class);
pipelineOptions.setBigQueryEndpoint(container.getEmulatorHttpEndpoint());
BigQueryServicesImpl bqService = new BigQueryServicesImpl();
bqService.getJobService(pipelineOptions);
Session session = buildExpectedSession();
WriteResult writeResult = p.apply(Create.of(session))
.apply(ParDo.of(new ProtobufSessionToBigQueryTableRow()))
.apply(BigQueryIO.writeTableRows()
.withTestServices(bqService)
.to(row -> {
return new TableDestination(projectId+":***.***", null);
}));
```
Thanks in advance for your help
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org