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

Separate billing project & destination project #365

Open
enzoapu opened this issue Nov 23, 2023 · 2 comments
Open

Separate billing project & destination project #365

enzoapu opened this issue Nov 23, 2023 · 2 comments

Comments

@enzoapu
Copy link

enzoapu commented Nov 23, 2023

Hi~ Thanks for developing and maintaining this repo🙏

I have questions about cross-project billing when using the BigQuery sink connector.

I have two projects, Project A and Project B. I want to write data to the dataset of Project A through the connector (upsertEnabled=True). However, I want to use the slots of Project B.

Therefore, I created the service account B-user under Project B and assigned necessary permissions to B-user in Project A.
Then in the connector configuration(properties), set:

project = projectA_id
keyfile = B-user.json

I expected that this would use query slots from Project B, but when I actually queried from the INFORMATION_SCHEMA.JOBS_BY_PROJECT of Project B, I could not see the query record related to B-user. Instead, it was in the INFORMATION_SCHEMA JOBS_BY_PROJECT of Project A has related MERGE query records of B-user.

SELECT
    *
FROM
    `projectB_id.region-us.INFORMATION_SCHEMA.JOBS_BY_PROJECT`
WHERE
    DATE(creation_time) >= CURRENT_DATE() - 7
    AND user_email = 'B-user@projectB_id.iam.gserviceaccount.com'

-
> There is no data to display. 

I think the source code assigned the project in the connector's properties as query billing account, instead of the project_id in the key.json.

My question is is there a way to separate billing from destination projects?

This will be of great help, thank you!!!

Enzo Chang

@b-goyal
Copy link
Member

b-goyal commented Dec 5, 2023

That's an interesting case @enzoapu . The connector only supports one project id which it accepts as configuration. It does not parse the keyfile an sends it directly to the client library. So, from the connector side I am not aware of any ways to separate the billing from the configured destination project.

@enzochang17
Copy link

Hello @b-goyal ,
Thank you for your explanation. Is it possible that this will become a future development feature?
I think this can help many companies who want to separate their billing accounts!

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

No branches or pull requests

3 participants