Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery: service.getDataset(DatasetId).get(String) does not find table in different project #1369

Closed
coryfoo opened this issue Jun 10, 2021 · 0 comments · Fixed by #1379
Closed
Assignees
Labels
20% candidate api: bigquery Issues related to the googleapis/java-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@coryfoo
Copy link

coryfoo commented Jun 10, 2021

Environment details

  1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
    General, Core, and Other are also allowed as types
  2. OS type and version: OSX / Linux
  3. Java version: JDK 11
  4. bigquery version(s): 1.111.0

Steps to reproduce

  1. Initialize BigQuery service in project A
  2. Call getDataset using a DatasetId consisting of another project (eg, project B) and a valid dataset in that project
  3. Call get for a table ID of a table that exists in that project.
  4. The get returns null, when it should return a Table object

Code example

final String projectA = "...";
final String projectB = "...";

final BigQuery instance = BigQueryOptions
        .newBuilder()
        .setProjectId(projectA)
        .build()
        .getService();

final String datasetName = "some_dataset";
final String tableName = "some_table";
final Dataset ds = instance.getDataset(DatasetId.of(projectB, some_dataset));
ds.get(tableName); // <--- this returns null, should not
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/java-bigquery API. label Jun 10, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 10, 2021
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Jun 16, 2021
@stephaniewang526 stephaniewang526 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. 20% candidate and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Jun 16, 2021
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Jun 16, 2021
@meredithslota meredithslota added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Jun 17, 2021
prash-mi added a commit to prash-mi/java-bigquery that referenced this issue Jun 18, 2021
prash-mi added a commit to prash-mi/java-bigquery that referenced this issue Jun 18, 2021
stephaniewang526 pushed a commit that referenced this issue Jun 19, 2021
* Adding the projectId used of getting the DataSet as a parameter for the issue: #1369

* Adding the projectId used of getting the DataSet as a parameter for the issue: #1369

* Added testcase for getTable with projectId.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
20% candidate api: bigquery Issues related to the googleapis/java-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants