hutiefang76 opened a new issue, #12901:
URL: https://github.com/apache/seatunnel/issues/12901
### Search before asking
- [x] I searched existing issues and open/closed PRs for this objective and
did not find a matching fix.
### What happened
Avro, ordinary JSON, CSV, Text and ordinary Protobuf deserializers stamp a
configured catalog table's path into `SeaTunnelRow.tableId` using
`Optional<TablePath>.toString()`. This produces
`Optional[database.schema.table]` rather than the table identifier
`database.schema.table`.
The data fields deserialize successfully, so the malformed metadata can
reach downstream consumers. Writers that look up or route by tableId can
receive a different key from the catalog table's path. This report concerns the
returned metadata; removing the wrapper alone does not change a connector's
routing priority or guarantee that every flat Pulsar pipeline routes to its
configured sink topic.
I reproduced the same assertion failure in all five formats using real
serialized payloads. The JSON reproduction uses `collect(byte[], Collector)`,
which is the path that stamps its metadata. Three controls without a catalog
table (JSON, CSV and Text) retain the expected empty tableId.
### SeaTunnel Version
Current `dev`, commit `e2957d27afa29d4de4324cf642450757d865b902`
(3.0.1-SNAPSHOT).
### SeaTunnel Config
This is reproducible directly through the format API without a job
configuration. For example, add this case to the existing
`AvroSerializationSchemaTest`:
```java
@Test
public void testPlainTableId() throws IOException {
SeaTunnelRowType rowType = new SeaTunnelRowType(
new String[] {"id"},
new SeaTunnelDataType<?>[] {BasicType.INT_TYPE});
CatalogTable table = CatalogTableUtil.getCatalogTable(
"catalog", "database", "schema", "table", rowType);
byte[] bytes = new AvroSerializationSchema(rowType)
.serialize(new SeaTunnelRow(new Object[] {7}));
SeaTunnelRow row = new
AvroDeserializationSchema(table).deserialize(bytes);
Assertions.assertEquals(table.getTablePath().toString(),
row.getTableId());
}
```
### Running Command
```sh
./mvnw -B -pl seatunnel-formats/seatunnel-format-avro -am
-Dtest=AvroSerializationSchemaTest#testPlainTableId
-Dsurefire.failIfNoSpecifiedTests=false package
```
### Error Exception
The expected value is `database.schema.table`; the actual value is
`Optional[database.schema.table]`.
The five-format reproduction ran 8 tests: 5 metadata assertion failures, 3
passing no-catalog controls, 0 errors and 0 skips. Avro/JSON/CSV/Text ran on
JDK 17; Protobuf ran on Linux x86_64/JDK 17 to avoid the separate macOS ARM
compiler issue #12897. No production source was changed for these reproductions.
### Zeta or Flink or Spark Version
Not needed for the direct API reproduction.
### Java or Scala Version
JDK 17.
### Screenshots
Not applicable.
### Are you willing to submit PR?
Yes, I am preparing a focused fix that unwraps the `TablePath`, preserves
no-catalog behavior and payload values, and adds the five format regressions
plus EN/ZH compatibility notes. Connector routing policy and Avro wire-layout
changes are outside this fix.
AI assistance was used for investigation and test drafting; the reported
reproductions were executed.
--
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]