DanielLeens commented on PR #11077:
URL: https://github.com/apache/seatunnel/pull/11077#issuecomment-5369023982

   @SEZ9 fair ask — here's the concrete evidence, independently reproduced 
rather than taken on faith from my own earlier comment:
   
   - Job: `Run / rocketmq-connector-it (11, ubuntu-latest)` on head 
`27da28820`: 
https://github.com/hesam-oxe/seatunnel/actions/runs/32261871864/job/96097595839
   - The same `seatunnel-api` compile failure cascades into essentially every 
`*-connector-it` job in that run (jdbc, doris, kafka, redis, elasticsearch, 
kudu, paimon, oracle-cdc, amazonSqs, connector-file-sftp, 
connector-sensorsdata, ...), because they all depend on `seatunnel-api` 
building first.
   - Exact error from the log:
     ```
     [ERROR] COMPILATION ERROR :
     [ERROR] 
.../seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSink.java:[298,31]
 error: incompatible types: Object cannot be converted to String
     [ERROR] Failed to execute goal ... maven-compiler-plugin:3.10.1:compile 
(default-compile) on project seatunnel-api
     ```
   
   I also re-checked this against the actual source at this head (not just the 
log): the new `getDestinationKey(...)` helper this PR adds declares 
`SeaTunnelSink sink = sinks.get(tablePath);` as a **raw type** (no generic 
parameters). Because `SeaTunnelSink` is generic, using it raw erases the 
generics through the whole chain — `sink.getWriteCatalogTable().map(...)` 
degrades to a raw `Optional`, and `.orElse(tablePath.toString())` on a raw 
`Optional` returns `Object`, not `String`. That's exactly the `String destTable 
= ...` assignment failing.
   
   This is PR-owned, not CI flakiness or an unrelated environment issue: `git 
diff` against `dev` confirms `getDestinationKey` and this exact raw-type 
declaration were added by this PR.
   
   Minimal fix, no design change needed — give `sink` its type parameters 
instead of the raw type:
   ```java
   SeaTunnelSink<?, ?, ?, ?> sink = sinks.get(tablePath);
   ```
   at that declaration (and the equivalent spot a few lines below if the same 
pattern repeats there). That restores proper typing through 
`.getWriteCatalogTable().map(...).orElse(...)`, and the `((CatalogTable) t)` 
cast inside the `.map(...)` lambda becomes unnecessary once `t` is properly 
typed as `Optional<CatalogTable>`.
   
   @hesam-oxe once this compiles, the two structural blockers SEZ9 and I 
already flagged still need to be closed before this is mergeable — the compile 
fix alone doesn't address either:
   1. Duplicated per-`SinkIdentifier` lifecycle calls 
(`snapshotState`/`prepareCommit`/`abortPrepare`/`close` firing N times on the 
same shared writer instance).
   2. The state lookup happening once inside `computeIfAbsent` on restore, so 
only the first aliased table's state is read.
   
   One process note: I'm relying here only on this independently-reproduced CI 
log and the current head's actual source. I can't vouch for the auxiliary 
branch/commit referenced in my prior comment beyond what's shown above, so 
please don't cherry-pick it sight-unseen — the three-line generics fix above is 
self-contained and verifiable directly against this PR's own head.


-- 
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]

Reply via email to