[Bug] [Connector-V2] Pulsar Source declares text format support but runtime rejects it
Search before asking
- [x] I had searched in the issues and found no similar issues.
What happened
Pulsar Source option contract and factory OptionRule claim that format = text is supported, but the runtime validation and deserialization path reject it.
Contract / docs mismatch:
PulsarBaseOptions.FORMATdescription says:Optional text and avro formatPulsarSourceFactoryOptionRule bindsfield_delimiterwhenformat = text- Source docs still document
field_delimiterfor text format
Runtime behavior:
PulsarMultiTableConfig.validateFormat()only allowsJSON,CANAL_JSONandAVRO(also applied to single-table configs)PulsarSource.createDeserialization()has noTEXTbranch and throwsUnsupported format: text
As a result, configuring Pulsar Source with format = text fails during config validation / source initialization.
Note: Pulsar Sink already supports text format via TextSerializationSchema. The dependency seatunnel-format-text is already present in connector-pulsar.
SeaTunnel Version
dev (master)
SeaTunnel Config
env {
parallelism = 1
job.mode = "BATCH"
}
source {
Pulsar {
topic = "persistent://public/default/test-topic"
client.service-url = "pulsar://localhost:6650"
admin.service-url = "http://localhost:8080"
subscription.name = "seatunnel-sub"
cursor.startup.mode = "EARLIEST"
cursor.stop.mode = "LATEST"
format = text
field_delimiter = ","
schema = {
fields {
id = "int"
name = "string"
}
}
}
}
sink {
Console {}
}
Running Command
./bin/seatunnel.sh --config config/pulsar_text_source.conf -e local
Error Exception
org.apache.seatunnel.connectors.seatunnel.pulsar.exception.PulsarConnectorException:
Pulsar source config uses unsupported format 'text', only JSON, CANAL_JSON and AVRO are supported
If validation were bypassed, deserialization would still fail with:
Unsupported format: text
Zeta or Flink or Spark Version
Zeta (local)
Java or Scala Version
Java 8 / 11
Screenshots
N/A
Root Cause
| Layer | Behavior for text |
|---|---|
PulsarBaseOptions.FORMAT |
Declares text as optional |
PulsarSourceFactory OptionRule |
Conditional field_delimiter for text |
PulsarMultiTableConfig.validateFormat() |
Rejects text |
PulsarSource.createDeserialization() |
No TEXT case |
| Pulsar Sink | Text is supported |
Expected Behavior
- Implement text format for Pulsar Source (recommended, aligns with OptionRule / Sink /
seatunnel-format-textdependency), including:- Allow
textinvalidateFormat()for single-table mode - Add
TextDeserializationSchemaincreateDeserialization()usingfield_delimiter - Keep multi-table restriction explicit if text remains unsupported there
- Update
docs/enanddocs/zhSource Pulsar docs accordingly
- Allow
Could a committer please add the help wanted label to this issue? I don't have permission to label it myself. Thanks!
Thanks for the careful report and for pointing out the contract/runtime mismatch.
I checked the current dev code path and this looks valid:
PulsarBaseOptions.FORMATdocumentstextandfield_delimiter.PulsarSourceFactoryexposesfield_delimiterwhenformat = text.PulsarMultiTableConfig.validateFormat()currently only allowsJSON,CANAL_JSON, andAVRO.PulsarSource.createDeserialization()also has noTEXTbranch, so bypassing validation would still fail at runtime.
I also checked for an obvious open PR covering Pulsar Source text support and did not find one. So the issue should be treated as a real Connector-V2 bug rather than only a documentation problem.
The likely implementation path is:
- decide whether
textshould be supported only for single-table Pulsar Source mode, while keeping the multi-table restriction explicit; - add the source-side text deserialization path using the existing text format support and
field_delimiter; - add focused source factory/config tests and a deserialization test;
- update both
docs/enanddocs/zhso the documented source behavior matches the runtime.
I'll mark this as bug / connectors-v2 / help wanted. A contributor can pick it up from the code paths above.
I'd like to work on this
Confirmed mismatch: PulsarBaseOptions.FORMAT and PulsarSourceFactory OptionRule advertise text format, but PulsarMultiTableConfig.validateFormat() only allows JSON/CANAL_JSON/AVRO and PulsarSource.createDeserialization() has no TEXT branch.
Preferred fix is to add TEXT support to the source using TextDeserializationSchema (seatunnel-format-text is already a dependency, and the sink already supports text). This should include adding TEXT to validateFormat(), a TEXT branch in createDeserialization() honoring field_delimiter, and an e2e/unit test.
If text support is intentionally not planned for the source, the alternative is to remove text from the option description, the OptionRule conditional binding, and the source docs to keep the contract consistent. Please indicate which direction you'd like; a PR is welcome either way.
Confirmed contract mismatch: PulsarBaseOptions.FORMAT and PulsarSourceFactory OptionRule advertise 'text' (with field_delimiter), but PulsarMultiTableConfig.validateFormat() only allows JSON/CANAL_JSON/AVRO and PulsarSource.createDeserialization() has no TEXT branch.
Preferred fix: add TEXT support to the source using TextDeserializationSchema (seatunnel-format-text is already a dependency, and the sink already supports text via TextSerializationSchema). Add a TEXT branch in createDeserialization(), allow TEXT in validateFormat(), and cover it with an e2e/unit test.
Alternative if text source support is intentionally unsupported: remove 'text' from FORMAT description, drop the field_delimiter binding for text in PulsarSourceFactory, and update the source docs accordingly. Please indicate which direction is desired; a PR would be welcome.
Reviewed community PR #11631 for this issue. The implementation wires TEXT into validation and TextDeserializationSchema, and the existing dependency/API path is compatible.\n\nBefore it is mergeable, the PR still needs:\n- Spotless fixes in PulsarSource.java; the module spotless:check reproduces these failures.\n- A regression test for single-table TEXT plus custom field_delimiter, and preferably a tables_configs case.\n- The invalid-format error text updated to include TEXT.\n\nGitHub Build is currently failing because the contributor's fork has not enabled CI. I requested changes on #11631 and will recheck the PR after a new head/green checks.
bug多多,特别是新版本。能跑通靠运气! 2026-08-04 18:39:59,509 INFO [o.a.s.e.c.j.ClientJobProxy ] [main] - Job (1136971568304357377) end with state FAILED 2026-08-04 18:39:59,510 INFO [c.h.c.LifecycleService ] [main] - hz.client_1 [seatunnel] [5.1] HazelcastClient 5.1 (20220228 - 21f20e7) is SHUTTING_DOWN 2026-08-04 18:39:59,513 INFO [.c.i.c.ClientConnectionManager] [main] - hz.client_1 [seatunnel] [5.1] Removed connection to endpoint: [localhost]:5801:ea1164cd-d812-4a1a-b059-7260b027b6ed, connection: ClientConnection{alive=false, connectionId=1, channel=NioChannel{/127.0.0.1:60830->localhost/127.0.0.1:5801}, remoteAddress=[localhost]:5801, lastReadTime=2026-08-04 18:39:59.498, lastWriteTime=2026-08-04 18:39:55.619, closedTime=2026-08-04 18:39:59.512, connected server version=5.1} 2026-08-04 18:39:59,514 INFO [c.h.c.LifecycleService ] [main] - hz.client_1 [seatunnel] [5.1] HazelcastClient 5.1 (20220228 - 21f20e7) is CLIENT_DISCONNECTED 2026-08-04 18:39:59,517 INFO [c.h.c.LifecycleService ] [main] - hz.client_1 [seatunnel] [5.1] HazelcastClient 5.1 (20220228 - 21f20e7) is SHUTDOWN 2026-08-04 18:39:59,517 INFO [s.c.s.s.c.ClientExecuteCommand] [main] - Closed SeaTunnel client...... 2026-08-04 18:39:59,517 INFO [s.c.s.s.c.ClientExecuteCommand] [main] - Closed metrics executor service ...... 2026-08-04 18:39:59,517 ERROR [o.a.s.c.s.SeaTunnel ] [main] -
===============================================================================
2026-08-04 18:39:59,518 ERROR [o.a.s.c.s.SeaTunnel ] [main] - Fatal Error,
2026-08-04 18:39:59,518 ERROR [o.a.s.c.s.SeaTunnel ] [main] - Please submit bug report in https://github.com/apache/seatunnel/issues
2026-08-04 18:39:59,518 ERROR [o.a.s.c.s.SeaTunnel ] [main] - Reason:SeaTunnel job executed failed
2026-08-04 18:39:59,519 ERROR [o.a.s.c.s.SeaTunnel ] [main] - Exception StackTrace:org.apache.seatunnel.core.starter.exception.CommandExecuteException: SeaTunnel job executed failed at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:266) at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40) at org.apache.seatunnel.core.starter.seatunnel.SeaTunnelClient.main(SeaTunnelClient.java:40) Caused by: org.apache.seatunnel.engine.common.exception.SeaTunnelEngineException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.seatunnel.connectors.doris.exception.DorisConnectorException: ErrorCode:[Doris-01], ErrorDescription:[stream load error] - stream load error: [LABEL_ALREADY_EXISTS]TStatus: errCode = 2, detailMessage = Label [test-cdc_mydb_t1_1136971568304357377_0_1] has already been used, relate to txn [2066], status [PREPARE]., see more in null
Confirmed mismatch on dev: PulsarBaseOptions.FORMAT description and PulsarSourceFactory OptionRule bind field_delimiter for format=text, but validateFormat() only allows JSON, CANAL_JSON, AVRO and createDeserialization() has no TEXT branch. Either the source should implement text deserialization or the contract/docs should drop text.
Preferred fix seems to be adding TEXT support: seatunnel-format-text is already a dependency of connector-pulsar, so adding a TEXT branch using TextDeserializationSchema (honoring field_delimiter) plus updating validateFormat() should align runtime with the declared contract. A contribution with an e2e/unit test would be welcome.
If maintainers decide text should not be supported on the source side, please also remove field_delimiter binding from PulsarSourceFactory's OptionRule and update the Pulsar source docs to avoid misleading users.
I would like to work on this issue.