Repository navigation
Conversation
|
Good job. Thanks a lot for your valuable contribution to Apache SeaTunnel! To pass the automated CI checks for this PR, could you please enable CI workflows in your forked repository first? You can refer to the check run link below as a reference for the required CI configuration https://github.com/apache/seatunnel/pull/11631/checks?check_run_id=91602399919 If you run into any trouble enabling CI or encounter related errors during the process, feel free to leave a comment here. Contributors are always ready to offer help~
|
nielifeng
left a comment
There was a problem hiding this comment.
Findings\n\n### [P1] Fix the Spotless violations before relying on CI\n\nRunning the module check against this head fails in PulsarSource.java. Spotless reports three changed-file violations: TextDeserializationSchema is imported before the json imports, the createDeserialization(...) call around lines 203-206 needs the formatter's multiline layout, and the delimiter(...) call around lines 281-282 must be kept on one line. The current GitHub Build is also failing, so this head is not merge-ready even though the implementation is small. Please run spotless:apply and rerun the checks.\n\n### [P1] Add a regression test for the new source TEXT path\n\nThe PR changes the user-facing contract from rejecting format=TEXT to constructing a TextDeserializationSchema, but it adds no tests. PulsarSourceTest and PulsarMultiTableConfigTest still cover JSON/AVRO/config behavior only. Please add at least a source test that builds a single-table TEXT config with a non-default field_delimiter, constructs the source, obtains the configured deserializer through the normal source path, and verifies a delimited payload becomes the expected SeaTunnelRow. Also cover a tables_configs entry so the merged per-table schemaConfig cannot silently lose the delimiter. This is especially important because the PR changes the createDeserialization signature and threads a new config object through the metadata construction path.\n\n### [P2] Keep the invalid-format message consistent with the accepted formats\n\nAfter adding TEXT to validateFormat(), the exception at PulsarMultiTableConfig.java:330 still says that only JSON, CANAL_JSON and AVRO are supported. An actually invalid format will now produce a misleading message. Include TEXT in the message or derive it from the same accepted-format definition.\n\n## Verification notes\n\n- Local spotless:check reproduces the changed-file formatting failures above.\n- The GitHub Build check is currently failing because CI is not enabled for the fork.\n- The source/config test run could not be completed locally because the temporary source snapshot cannot compile the existing generated config-shade classes; this does not replace the missing PR regression coverage.
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for working on this. I reviewed the full current head 544fff2d51.
+1 to @nielifeng's earlier Spotless point on this head. I am not going to duplicate that finding as a separate numbered Daniel issue. On top of that, I found two more current-head blockers below.
PR solves what problem
- User pain: the Pulsar source currently rejects
format = text, so users cannot consume text payloads through the Pulsar source path even though the sink side already supports text formatting. - Fix approach: allow
TEXTin Pulsar source validation and build aTextDeserializationSchemawith the configured field delimiter. - One-line summary: the feature direction is reasonable, but the current head still is not mergeable because the branch is stacked on unrelated commits and the new Pulsar source path is not covered by focused tests.
I. Code change review
1.1 Core logic analysis
Precise change:
PulsarMultiTableConfig.validateFormat(...)now acceptsTEXT.PulsarSource.createDeserialization(...)now buildsTextDeserializationSchemaand threadsFIELD_DELIMITERfrom the schema config.
Before / After:
- Before: the Pulsar source rejected
TEXTformat and never built a text deserializer. - After: the source accepts
TEXTand routes it throughTextDeserializationSchema. - But the current head also includes commit
6bf786bee7and commitac8306f332, which are unrelated to Pulsar source text-format support.
Key findings:
- The intended source-path addition is straightforward.
- The review head is not isolated to that scope.
- I did not find any focused Pulsar-source test covering the new
TEXTvalidation/deserialization path on this head. - I do not want to merge an uncovered new source path on top of a stacked branch.
Logic correctness / runtime path:
Pulsar source startup
-> createConsumerMetadata(...)
-> createDeserialization(format, catalogTable, schemaConfig)
-> TEXT
-> TextDeserializationSchema.builder()
.seaTunnelRowType(...)
.delimiter(schemaConfig.get(FIELD_DELIMITER))
Validation path
-> PulsarMultiTableConfig.validateFormat(...)
-> now accepts TEXT
1.2 Compatibility impact
- Intended feature change is backward compatible.
- The stacked unrelated commits make the current head non-isolated.
1.3 Performance / side-effect analysis
- The new text-deserialization path is cheap.
- The real risk here is correctness coverage, not runtime cost.
1.4 Error handling and logs
Problem 1: current head is stacked on unrelated commits
- Location:
seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/multitablesink/SchemaChangeBarrier.java,seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/AbstractReadStrategy.java - Problem description: besides the Pulsar source change, this review head also carries unrelated schema-evolution and file-reader commits (
6bf786bee7,ac8306f332). - Potential risk: the PR can no longer be reviewed or merged as a focused Pulsar-source change.
- Best improvement suggestion: rebase/split the branch so this PR only contains the Pulsar text-format work.
- Severity: High
- Already raised by others: No
Problem 2: the new Pulsar source TEXT path is missing focused test coverage
- Location:
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:265,seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/config/PulsarMultiTableConfig.java:320 - Problem description: the PR adds a new accepted format and a new deserializer branch, but the current head does not add a focused Pulsar-source unit/integration test for that path.
- Potential risk: validation can drift from runtime behavior, delimiter handling can break silently, and the new format support may regress without any Pulsar-specific signal.
- Best improvement suggestion: add at least a focused Pulsar-source test that covers
format = textand delimiter wiring on the source side. - Severity: High
- Already raised by others: No
II. Code quality assessment
2.1 Code style
The implementation is readable, aside from the separate Spotless issue already raised by @nielifeng.
2.2 Test coverage and stability
Current coverage is insufficient for the new Pulsar source path because there is no focused test for TEXT support.
2.3 Documentation updates
If this lands, the user-facing Pulsar source docs/examples should also mention TEXT support explicitly.
III. Architecture
3.1 Solution elegance
The intended source-path addition is precise.
3.2 Maintainability
It will be maintainable once the branch is isolated and the new path has dedicated tests.
3.3 Extensibility
Adding source-side text support is reusable for future Pulsar-source enhancements.
3.4 Historical compatibility
Compatible after the blockers are fixed.
IV. Problem summary
| No. | Problem | Location | Severity |
|---|---|---|---|
| 1 | Current head is stacked on unrelated commits | SchemaChangeBarrier.java, AbstractReadStrategy.java |
High |
| 2 | New Pulsar source TEXT path is missing focused test coverage | PulsarSource.java:265, PulsarMultiTableConfig.java:320 |
High |
V. Merge conclusion
Conclusion: can merge after fixes
- Blocking items
- Problem 1: please split/rebase the branch so the PR only contains the Pulsar text-format work.
- Problem 2: please add focused Pulsar-source coverage for the new
TEXTpath.
- Suggested follow-ups
- Also fix the Spotless issue already raised by @nielifeng on this head.
Overall, the feature idea makes sense. The blockers are the current head composition and the missing Pulsar-specific coverage.
|
Thanks for your contribution! This is a solid addition to the project, and your attention to detail really shows. Contributors like you are what keep this community moving forward. Feel free to keep the PRs coming — we're always glad to have you here! Please ignore the following message if you have joined in the Slack~ |
|
PR #11792 Merged, Thank you for your efforts. |

Description
The Pulsar Source option contract and factory OptionRule claim that
format = textis supported, but the runtime validation and deserialization path reject it:PulsarSourceFactoryOptionRule bindsfield_delimiterwhenformat = textPulsarBaseOptions.FORMATdescription says "Optional text and avro format"TextSerializationSchemaseatunnel-format-textdependency is already present inconnector-pulsarHowever,
PulsarMultiTableConfig.validateFormat()only allows JSON, CANAL_JSON and AVRO, andPulsarSource.createDeserialization()has no TEXT branch.Changes
PulsarMultiTableConfig.java — Allow
TEXTinvalidateFormat()so thatformat = textpasses configuration validation.PulsarSource.java — Add a
TEXTcase increateDeserialization()that returns aTextDeserializationSchemaconfigured with the user-specifiedfield_delimiter. TheschemaConfig(ReadonlyConfig) is now passed through tocreateDeserialization()so it can readFIELD_DELIMITER.Verification
After this fix, a Pulsar Source with
format = textandfield_delimiter = ","will:TextDeserializationSchemato deserialize text-format messagesseatunnel-format-textdependencyFixes #11620