Skip to content

Conversation

dyp12
Copy link
Contributor

@dyp12 dyp12 commented Sep 1, 2025

Purpose of this pull request

close #9773

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

Comment on lines +40 to +42
- [x] canal_json
- [x] debezium_json
- [x] maxwell_json
Copy link
Member

Choose a reason for hiding this comment

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

Have you checked the behavior of canal_json and maxwell_json? I'm not sure about it should merge or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have you checked the behavior of canal_json and maxwell_json? I'm not sure about it should merge or not.

‌I don't understand what you mean‌. merge only add update event data, canal_json and maxwell_json support update type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have you checked the behavior of canal_json and maxwell_json? I'm not sure about it should merge or not.

are you mean‌ merge code ? the behavior of canal_json and maxwell_json merge in #9336, i just add doc, in #9336 only add zh doc

Copy link
Member

Choose a reason for hiding this comment

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

Never mind, I checked the canal_json and maxwell_json support UPDATE (without UPDATE_BEFORE and UPDATE_AFTER).

@Hisoka-X Hisoka-X changed the title [Feature][S3-Sink] Improve maxwell_json,canal_json,debezium_json format [Feature][Format] Improve maxwell_json,canal_json,debezium_json format support merge update_before and update_after Sep 3, 2025
Comment on lines 57 to 60
this.options = new HashMap<>();
this.options.put(
CanalJsonFormatOptions.MERGE_UPDATE_EVENT.key(),
textFileSinkConfig.getMergeUpdateEvent().toString());
Copy link
Member

Choose a reason for hiding this comment

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

why introduce options? Let's keep the code simple.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why introduce options? Let's keep the code simple.

if not, the CanalJsonSerializationSchema() will add a param. if we want change other , will add a param,and the CanalJsonSerializationSchema() will have many param. use Map can keep the code simple.

Copy link
Member

Choose a reason for hiding this comment

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

Let's add it when we really need it. But I think we don't need this for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's add it when we really need it. But I think we don't need this for now.

i fixed it

@@ -158,6 +157,7 @@ private void parsePayload(Collector<SeaTunnelRow> out, TablePath tablePath, Json
if (tsNode != null) {
MetadataUtil.setEventTime(after, tsNode.asLong());
}
out.collect(before);
Copy link
Member

Choose a reason for hiding this comment

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

Why moved this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why moved this?

if parse DATA_AFTER have error, out.collect(before) and out.collect(after) together can make sure before and after data send to target , not only send before

Copy link
Member

Choose a reason for hiding this comment

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

Got it.

@@ -204,6 +203,7 @@ public void deserializeMessage(
if (tsNode != null) {
MetadataUtil.setEventTime(after, ts);
}
out.collect(before);
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature][S3-Sink] Improve maxwell_json,canal_json,debezium_json format
2 participants