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

[CDAP-20948] BigQuery Delta Replication Plugin DataSet Project ID Fix #259

Merged

Conversation

shivamVarCS
Copy link
Contributor

@shivamVarCS shivamVarCS commented Jan 22, 2024

Objective : BugFix for BigQuery Delta Plugin: Unable to fetch maximum sequence number from existing tables by using Dataset Project Id.

Jira: Link

@sau42shri sau42shri requested a review from rmstar January 23, 2024 07:14
Copy link
Contributor

@rmstar rmstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove references to customer name and link to the Jira ticket for this issue

@@ -43,7 +43,7 @@ that the BigQuery job will run in. `BigQuery Job User` role on this project must
account to run the job. If a temporary bucket needs to be created, the bucket will also be created in this project and
'GCE Storage Bucket Admin' role on this project must be granted to the specified service account to create buckets.

**Dataset Project ID**: Project the destination dataset belongs to. This is only required if the dataset is not
**Dataset Project ID**: Project Id for the destination dataset belongs to. This is only required if the dataset is not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@rmstar
Copy link
Contributor

rmstar commented Jan 24, 2024

Can we add a test?

@shivamVarCS shivamVarCS force-pushed the bugfix/315193699-big-query-delta-replication-fix-panw branch from b1eb578 to d55f585 Compare January 25, 2024 04:46
@shivamVarCS
Copy link
Contributor Author

Please remove references to customer name and link to the Jira ticket for this issue

Sure, will follow up next time

@shivamVarCS
Copy link
Contributor Author

Can we add a test?

I have modified the existing test cases which verifies the latest changes

@rmstar
Copy link
Contributor

rmstar commented Jan 25, 2024

Please remove references to customer name and link to the Jira ticket for this issue

Sure, will follow up next time

Please edit PR description. Add link to Jira.

@@ -193,7 +193,7 @@ public void testGetMaximumExistingSequenceNumberForRetryableFailures() throws Ex
bqTarget.initialize(deltaTargetContext);
} finally {
//verify at least 1 retry happens
PowerMockito.verifyStatic(BigQueryUtils.class, Mockito.atLeast(2));
PowerMockito.verifyStatic(BigQueryUtils.class, Mockito.atLeast(1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did this test change? It seems unrelated to your changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the new code changes, we do need to mock it twice, as it only requires 1 retry and if mocked twice. it break test in the second retry.

BigQueryUtils.getMaximumExistingSequenceNumber(context.getAllTables(), project, conf.getDatasetName(),
bigQuery, encryptionConfig, MAX_TABLES_PER_QUERY));
BigQueryUtils.getMaximumExistingSequenceNumber(context.getAllTables(), conf.getDatasetProject(),
conf.getDatasetName(), bigQuery, encryptionConfig, MAX_TABLES_PER_QUERY));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: revert ident change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project and conf.getDatasetproject() both are different project Id's.
Earlier it was pointing to project, now we are passing DatasetProjectId.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to say that we should revert the whitespace change (indent), not code change to point to the right project id

@shivamVarCS shivamVarCS changed the title BugFix for PANW Issue BigQuery Delta Replication Plugin DataSet Project ID Fix Jan 25, 2024
@rmstar rmstar added the build label Jan 25, 2024
@shivamVarCS shivamVarCS merged commit a97972b into develop Jan 25, 2024
5 checks passed
@itsankit-google itsankit-google changed the title BigQuery Delta Replication Plugin DataSet Project ID Fix [CDAP-20948] BigQuery Delta Replication Plugin DataSet Project ID Fix Jan 31, 2024
@itsankit-google itsankit-google deleted the bugfix/315193699-big-query-delta-replication-fix-panw branch January 31, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants