You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhang-arvin (via GitHub)" <gi...@apache.org> on 2026/08/31 15:01:24 UTC
[PR] [Fix][Connector-V2] Fix Oracle CDC split generation error when analyze table fails [seatunnel]
zhang-arvin opened a new pull request, #12024:
URL: https://github.com/apache/seatunnel/pull/12024
### Purpose
Fix Oracle CDC connector fails with 'Generate Splits' error when the `analyze table` statement times out on Oracle.
### Problem
When the Oracle CDC connector runs `analyze table ... compute statistics for table` to estimate row count for chunk splitting, the analyze statement can fail due to Oracle session timeouts (e.g., `No more data to read from socket`). This causes the entire split generation to fail with `Generate Splits for table XXX` error.
### Root Cause
In `OracleUtils.queryApproximateRowCnt()`, the `jdbc.execute(analyzeTable)` call is not wrapped in a try-catch. When it fails, the `SQLException` propagates up and causes the split generation to fail.
### Fix
Wrap the `analyze table` execution in a try-catch. When the analyze fails:
1. Log a warning with the error message
2. Fall back to using `select count(*)` to get the row count
This makes the Oracle CDC split generation resilient to Oracle session timeout issues.
### Related Issue
Closes #12019
### Checklist
- [x] Code compiles correctly
- [x] Formatting applied (spotless:apply)
- [ ] Tests added (no logic change to test — this is a defensive error-handling fix)
- [ ] Documentation updated (no user-facing config changes)
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2] Fix Oracle CDC split generation error when analyze table fails [seatunnel]
Posted by "zhang-arvin (via GitHub)" <gi...@apache.org>.
zhang-arvin commented on PR #12024:
URL: https://github.com/apache/seatunnel/pull/12024#issuecomment-6051450734
@DanielLeens Thanks for the precise diagnosis. Fixed both items and pushed:
1. **Issue #1 (compile blocker)**: `rowCountQuery` is now declared `final` and assigned exactly once on each path (the analyze-fallback branch builds an intermediate `String query` and only assigns `rowCountQuery` once at the end). The lambda capture of `rowCountQuery` now compiles.
2. **Issue #2 (dead write)**: removed the `useSelectCount = true;` statement; the fallback now just reassigns the local query.
Also de-duplicated the `select count(*)` format string into a single `selectCountQuery`. Verified locally with the project toolchain (JDK 8): `./mvnw -o compile -pl connector-cdc-oracle` passes, and `spotless:apply` is clean. New head: `692c6bda5`.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org