ilyasahsan123 commented on PR #41331:
URL: https://github.com/apache/beam/pull/41331#issuecomment-7154298994
> Thanks for this, Ilyas. The mapping is clean and it follows the
transaction event pattern well. I rebuilt the head version of SourceRecordJson
from the diff and ran it against records built with the Debezium 3.5.2 schemas.
ALTER, DROP with a null table, several table changes and an empty tableChanges
list all map without errors.
Thanks for testing it, and for checking the edge cases too. That's very
helpful.
> There is one point I would like to settle before merge. The description
says DebeziumIO skips these events today. I do not see that in the code.
KafkaSourceConsumerFn maps every record, and on master a schema change record
comes out as {"metadata":{...},"before":null,"after":null}. Debezium also
defaults include.schema.changes to true, so for MySQL, Oracle and SQL Server
users who never set the property, this PR changes the shape of records they
already receive.
You're right, I was wrong about that. `DebeziumIO` does not skip these
events. I've fixed the description and the `README` to say this.
> I would prefer that existing pipelines see no change at all. I suggest an
opt in flag, withSchemaChangeEvents(true) on DebeziumIO.Read, false by default
and wired like withFullMetadata from https://github.com/apache/beam/pull/40702,
so schema_change_events in Python and SchemaChangeEvents() in Go. With the flag
off, schema change records keep the shape they have on master. With the flag
on, they keep metadata, before and after and gain databaseName, schemaName,
ddl, ts_ms and tableChanges, so withFullMetadata(true) still applies and
snapshot stays available. The transaction metadata change in
https://github.com/apache/beam/pull/40785 needed no flag because
provide.transaction.metadata defaults to false in Debezium.
Agreed, and done. I added `withSchemaChangeEvents(true)` on
`DebeziumIO.Read`. It's off by default and wired like `withFullMetadata`.
> Two small things on the description. The two examples show different
statements, one sets first_name to TEXT and the other to varchar(255). The
output example lists four attributes per column, the code emits all fifteen
with nulls, plus defaultCharsetName and comment on the table.
Thanks, fixed. The description now uses one statement (`first_name
varchar(255)`) and the output example shows all 15 column attributes, plus
defaultCharsetName and comment on the table.
> The rest is inline and none of it blocks. Db2 is the one where I would
like a decision.
I've included Db2.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]