-
Notifications
You must be signed in to change notification settings - Fork 7
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
[CDAP-20948] BigQuery Delta Replication Plugin DataSet Project ID Fix #259
Conversation
There was a problem hiding this 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
docs/bigquery-cdcTarget.md
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Can we add a test? |
b1eb578
to
d55f585
Compare
Sure, will follow up next time |
I have modified the existing test cases which verifies the latest changes |
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)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: revert ident change
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Objective : BugFix for BigQuery Delta Plugin: Unable to fetch maximum sequence number from existing tables by using Dataset Project Id.
Jira: Link