Repository navigation
Pulsar IO: Make Source topic Schema information available to downstream Sinks - #8854
Conversation
|
@315157973 @nlu90 @jerrypeng This can be considered a small breaking behavior change, but I would like to see it cherry picked to 2.7.x branch if possible |
|
If it is possible to see this also on 2.6.3 it would be greater |
|
@codelipenghui let's cherry-pick this change to 2.6.3 release. |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
1 similar comment
|
/pulsarbot run-failure-checks |
|
There is a test failure related to schemas and Pulsar functions. |
|
The problem in the test is that PulsarSink is using the record schema to write to the destination topic, but this is wrong because it must use the schema of the destination topic. |
|
/pulsarbot run-failure-checks |
|
many jobs failed with |
|
@lhotari @codelipenghui @sijie CI errors seems not related to my patch, |
23a6089 to
0ab552c
Compare
|
I have rebased onto current master |
|
btw I thought that the PR validation is run against the PR branch merged with the target branch, so rebasing onto latest master should not have much effect |
|
/pulsarbot run-failure-checks |
1 similar comment
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
- extract original Schema from the message read from the topic - expose the schema to the PulsarRecord implement
bccbe89 to
df995f5
Compare
|
/pulsarbot run-failure-checks |
…am Sinks (#8854) ## Changes: - extract original Schema from the message read from the topic - expose the schema into the PulsarRecord implementation - add unit test - in PulsarSink detect the fact that the source record is directly from a PulsarSource and drop the schema (there was already a check about the fact that the source record is a PulsarRecord, so this patch is not adding a new shortcircuit) - little refactor in PulsarSink in order to make it clear that we are working with SinkRecord (casts were already present in the code, and it would not have worked without SinkRecord, so we are only tidying it up) ### Motivation Pulsar sinks cannot access the original Schema of the Message they are consuming, this is because currently PulsarSource does not publish the Schema information to downstream processing. ### Modifications Try to retrieve Schema information from the Message and push it down to the Record. ### Verifying this change - [X] Make sure that the change passes the CI checks. - [X] This change added tests and can be verified as follows: - added unit test - tested manually with Pulsar Standalone - there are existing unit and integration tests that are touching this change (in fact I had to iterate a few times) ### Does this pull request potentially affect one of the following parts: yes with this change Pulsar function users and especially Pulsar I/O Sinks will be able to inspect the original schema in case the processing starts from a Pulsar topic (PulsarSource) (cherry picked from commit 0e6ad1c)
…am Sinks (#8854) ## Changes: - extract original Schema from the message read from the topic - expose the schema into the PulsarRecord implementation - add unit test - in PulsarSink detect the fact that the source record is directly from a PulsarSource and drop the schema (there was already a check about the fact that the source record is a PulsarRecord, so this patch is not adding a new shortcircuit) - little refactor in PulsarSink in order to make it clear that we are working with SinkRecord (casts were already present in the code, and it would not have worked without SinkRecord, so we are only tidying it up) ### Motivation Pulsar sinks cannot access the original Schema of the Message they are consuming, this is because currently PulsarSource does not publish the Schema information to downstream processing. ### Modifications Try to retrieve Schema information from the Message and push it down to the Record. ### Verifying this change - [X] Make sure that the change passes the CI checks. - [X] This change added tests and can be verified as follows: - added unit test - tested manually with Pulsar Standalone - there are existing unit and integration tests that are touching this change (in fact I had to iterate a few times) ### Does this pull request potentially affect one of the following parts: yes with this change Pulsar function users and especially Pulsar I/O Sinks will be able to inspect the original schema in case the processing starts from a Pulsar topic (PulsarSource) (cherry picked from commit 0e6ad1c)
Changes:
Motivation
Pulsar sinks cannot access the original Schema of the Message they are consuming,
this is because currently PulsarSource does not publish the Schema information to downstream processing.
Modifications
Try to retrieve Schema information from the Message and push it down to the Record.
Verifying this change
Does this pull request potentially affect one of the following parts: yes
with this change Pulsar function users and especially Pulsar I/O Sinks will be able to inspect the original schema in case the processing starts from a Pulsar topic (PulsarSource)