-
Notifications
You must be signed in to change notification settings - Fork 972
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
Seamlessly propagate schema changes made after pipelines starts running for Spanner Change Streams to BigQuery template #1678
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Integration tests will be added in a future PR. Do not merge now. |
ac239fc
to
c8c5336
Compare
|
||
// For "INSERT" mod, we can get all columns from mod. | ||
if (mod.getModType() == ModType.INSERT) { | ||
// For "DELETE" mod, we can simply populate null for all tracking columns. |
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.
"For "DELETE" mod, we only set the key columns. For all non-key columns, we already populated "null".
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.
Fixed the comment.
@@ -181,7 +183,7 @@ public void setUp() { | |||
"Caught exception when setting up FailsafeModJsonToTableRowFn, message: %s," | |||
+ " cause: %s", | |||
Optional.ofNullable(e.getMessage()), e.getCause())); | |||
seenException = true; |
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 was this removed?
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.
Because we still want the first error message to be printed at later stage when process the element here.
@ShuranZhang could you also add thiago as reviewer? |
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.
LGTM, few suggestions
@@ -453,7 +476,7 @@ private static DeadLetterQueueManager buildDlqManager( | |||
? tempLocation + "dlq/" | |||
: options.getDeadLetterQueueDirectory(); | |||
|
|||
LOG.info("Dead letter queue directory: {}", dlqDirectory); | |||
LOG.info("Dead letter queue directory: {}" + dlqDirectory); |
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 should be as it was ({} is replaced by the parameter)
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.
Done.
this.modType = modType; | ||
this.valueCaptureType = valueCaptureType; | ||
this.numberOfRecordsInTransaction = numberOfRecordsInTransaction; | ||
this.numberOfPartitionsInTransaction = numberOfPartitionsInTransaction; | ||
this.rowTypeAsMap = rowType == null ? Collections.emptyMap() : new HashMap<>(); |
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: can't we always assign a new HashMap<>? Or do you want it to be unmodifiable when rowType is null?
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 am also not sure on the intention as I was not the original author here.
@ChangyuLi28 Could you please take a look here? Thanks!
@@ -0,0 +1,43 @@ | |||
/* |
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 say we would need more tests here to improve the coverage of TypesUtils since it does a lot of String manipulation
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.
Done. I added tests to cover all string manipulation branches inTypesUtils.java
.
…ng for Spanner Change Streams to BigQuery template.
This pr supports schema updates after pipeline starts running.
Follow this guide to deploy pipelines with this template. More specific instructions.