GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ExtractJobConfiguration's setProjectId makes cross-project BQ extracts impossible · Issue #3924 · googleapis/google-cloud-java

ExtractJobConfiguration's setProjectId makes cross-project BQ extracts impossible #3924

New issue
Copy link
New issue
Copy link
Closed
Closed
ExtractJobConfiguration's setProjectId makes cross-project BQ extracts impossible#3924
Copy link
Assignees
ajaaym
Labels
api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@clairemcginty
clairemcginty
opened on Nov 8, 2018
Issue body actions

Hi! I was looking into migrating one of our projects from google-api-services-bigquery to google-cloud-bigquery & noticed a possible regression in the Extract job config in the client library. One of our integration tests extracts data from bigquery-public-data:samples.shakespeare into a GCS bucket in our own GCP project. However, after migrating, the test fails because the extract job can't find the BQ table {OUR_GCP_PROJECT}:samples.shakespeare.

some scala code replicating the issue:

val gcpProject = "some-gcp-project"
val bqClient: com.google.cloud.bigquery.BigQuery = ... // authenticated to $gcpProject

val sourceTableId = TableId.of("bigquery-public-data", "samples", "shakespeare")
val destGcsUri = s"gs://$gcpProject/it/${UUID.randomUUID}"

val config = ExtractJobConfiguration
    .newBuilder(sourceTableId, destGcsUri)
    .setFormat("AVRO")

val jobInfo = JobInfo.newBuilder(config.build()).build()
print(jobInfo)

val job = bqClient.create(jobInfo).waitFor()
print(job.getStatus.getError)

this prints

JobInfo{job=null, status=null, statistics=null, userEmail=null, etag=null, generatedId=null, selfLink=null, configuration=ExtractJobConfiguration{type=EXTRACT, sourceTable={datasetId=samples, projectId=bigquery-public-data, tableId=shakespeare}, destinationUris=[gs://some-gcp-project/it/9270d23f-de63-41e8-a56a-e7c140297e38], format=AVRO, printHeader=null, fieldDelimiter=null, compression=null}}

and

BigQueryError{reason=notFound, location=null, message=Not found: Table some-gcp-project:samples.shakespeare was not found in location US}[info].

I think the reason is because ExtractJobConfiguration overrides setProjectId to apply the credentialed projectId param specifically to the source table, overriding what it was originally set to.

wdyt? Am I just mis-using the new API?

thanks!

Reacted by lmittmann

Activity

  1. JustinBeckwith
    added
    triage meI really want to be triaged.
    on Nov 9, 2018
  2. kmevissen commented on Nov 9, 2018

    @kmevissen
    kmevissen
    on Nov 9, 2018
    More actions

    I experienced something similar when creating a table in BigQuery, where projectId seems to be re-set with the projectId from BigQueryOptions. So passing the project in the TableId also had no effect.

    By setting the projectId to the desired project when creating a BigQuery client I managed to work around this:

    BigQuery bigquery = BigQueryOptions.newBuilder().setProjectId("projectName").build().getService();

  3. sduskis
    added
    api: bigqueryIssues related to the BigQuery API.
    on Nov 9, 2018
  4. chingor13
    added
    type: questionRequest for information or clarification. Not an issue.
    on Nov 12, 2018
  5. JustinBeckwith
    removed
    triage meI really want to be triaged.
    on Nov 12, 2018
  6. ajaaym
    added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    type: questionRequest for information or clarification. Not an issue.
    on Dec 4, 2018
  7. ajaaym
    added a commit that references this issue on Dec 5, 2018

    Fix googleapis#3924 ExtractJobConfiguration's setProjectId makes cros…

    This issue will close once commit 2dbf234 is merged into the 'master' branch.
    2dbf234
  8. ajaaym
    closed this as completedin #4183on Dec 6, 2018
  9. ajaaym
    added a commit that references this issue on Dec 6, 2018

    BigQuery: Allow job to extract or load table across projects (#4183)

    This issue will close once commit d122744 is merged into the 'main' branch.
    d122744
  10. snehashah16
    added a commit that references this issue on Feb 3, 2019

    Merge request (#4436)

    This issue will close once commit 47c840e is merged into the 'main' branch.
    47c840e
  11. JustinBeckwith
    assigned
    ajaaym
    on Feb 1, 2021
  12. suztomo
    added a commit that references this issue on Mar 9, 2026

    deps: update dependency com.google.cloud:sdk-platform-java-config to …

    cb66be5
  13. lqiu96
    added a commit that references this issue on Mar 20, 2026

    deps: update dependency com.google.cloud:sdk-platform-java-config to …

    4d04669
  14. chingor13
    added 2 commits that reference this issue on Mar 24, 2026

    chore: Remove Gemini CLI GH Actions (#3924)

    40a0852

    chore(deps): update dependency com.google.cloud:libraries-bom to v26.…

    83c12eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @ajaaym
    ajaaym

Labels

api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.