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

BQ Peer: Support project dot dataset #1073

Merged
merged 3 commits into from
Jan 23, 2024
Merged

Conversation

Amogh-Bharadwaj
Copy link
Contributor

@Amogh-Bharadwaj Amogh-Bharadwaj commented Jan 12, 2024

Service account JSONs can have permissions granted on them to access datasets in other projects. This PR supports datasetID being entered as project.dataset in the BQ peer, where the project is not the one specified in the SA

The main changes are:
1

client.Dataset(dataset)
// now becomes
client.DatasetInProject(project,dataset)

2

query := client.Query(..)
query.DefaultDatasetID := datasetID
query.DefaultProjectID := projectID
_, err := query.Read()

@Amogh-Bharadwaj Amogh-Bharadwaj marked this pull request as draft January 12, 2024 18:48
@Amogh-Bharadwaj Amogh-Bharadwaj marked this pull request as ready for review January 19, 2024 20:13
@Amogh-Bharadwaj Amogh-Bharadwaj merged commit cd6086c into main Jan 23, 2024
11 checks passed
@Amogh-Bharadwaj Amogh-Bharadwaj deleted the bq/support-dataset-dot branch January 23, 2024 17:48
iskakaushik pushed a commit that referenced this pull request Jan 25, 2024
`DefaultDatasetID` and `DefaultProjectID` work only for unqualified
tables. This PR unqualifies our tables in bigquery queries for qrep and
cdc.

Will update our docs to explicitly say that we support cross-project
mode only for CDC and QRep (BQ). This is yet to be integrated for resync
mirror

This PR has been functionally tested with two projects.

Follow up to #1073
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants