JNSimba opened a new pull request, #71298:
URL: https://github.com/apache/doris/pull/71298

   ### Background
   
   Streaming CDC jobs discover source tables, create Doris target tables, and 
apply source column changes. The FE currently uses catalog JDBC clients for 
source validation and initial schemas, while the CDC client reads source data 
and handles later schema changes. The `cdc_stream` TVF has another schema 
discovery path.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Enhancement
   
   Problem Summary:
   
   Separate discovery and mapping paths can give the same source column 
different Doris types during table creation, TVF analysis, and `ADD COLUMN`. 
Source inspection now uses the CDC client's bundled drivers through the 
existing BE forwarding RPC, with shared source type mappers and structured 
schema-change requests. The change also moves source validation and publication 
preparation alongside discovery; most of the diff covers unit, source 
integration, and regression tests. Existing source driver properties remain 
accepted but are no longer loaded or forwarded.
   
   ### Details
   
   - **Change map:** Production code: +2,196/-1,176 lines; tests and fixtures: 
+5,173/-1,228; regression expected outputs: +190/-59; build: +7/-0; docs: 0. 
Tests and fixtures account for about 64% of changed lines.
     - FE discovery and command execution (+648/-648): shared schema DTOs, BE 
RPC inspection, Doris type parsing, and scoped CREATE/ALTER execution replace 
source catalog clients.
     - CDC metadata and mapping (+1,547/-528): bundled source connections, 
PostgreSQL resource checks, common schema/TVF/ADD mapping, SSL configuration, 
and consistent numeric decoding.
   - **Before and after:** One MySQL/PostgreSQL mapper now determines initial, 
TVF, and added-column types. The FE retains job-creator authorization and 
target-table scope checks; structured ADD/DROP operations retain retry 
idempotence. Altering a paused job's `include_tables` prepares its owned 
PostgreSQL publication through CDC, preserving existing members; custom and 
legacy publications are validated without modification. Keyless job tables are 
rejected before publication changes, while ordinary TVFs still allow them.
   - **Configs and defaults:** No new user configuration. Legacy `driver_url` 
and `driver_class` are optional compatibility properties and are ignored. JDBC 
URL defaults are retained, source inspection defaults to one-minute 
connection/socket timeouts, and SSL readers and inspection share SmallFile 
certificate handling. Nine unsafe MySQL JDBC options are rejected during 
create, update, and reader startup.
   - **Impact on existing users:** Source connectivity is required from the 
BE/CDC host. The new schema RPC requires compatible FE and CDC client versions; 
paused work can be retried after versions align. Type and value changes are 
listed below; source properties and existing target tables are not rewritten.
   
   FE never connects directly to the source; runtime DDL reuses the schema 
mapper.
   
   ```mermaid
   flowchart LR
       A["FE CREATE / TVF / ALTER JOB"] --> B["BE RPC forwarding"]
       B --> C["CDC validation, schemas & shared mapper"]
       C <--> D[("MySQL / PostgreSQL / OceanBase")]
       C -->|schemas| E["FE analyze / execute"]
       D -->|column changes| F["CDC runtime DDL / shared mapper"]
       F -->|structured ADD / DROP| E
   ```
   
   ### Testing
   
   - CDC standard Spotless check: 56 files clean; standard `build.sh 
--be-cdc-client`: passed.
   - Targeted CDC unit tests: 193/193 passed, covering mapping, schema 
requests, structured DDL, and inline event deserialization boundaries.
   - `GetTableSchemasITCase`: 5/5 passed against real sources, including 
idempotent publication expansion and rejection of keyless tables without 
affecting source UPDATEs.
   - FE standard build and Checkstyle: passed. Targeted FE unit tests: 61/61 
passed (StreamingJobUtilsTest 17, StreamingInsertJobSchemaPersistenceTest 17, 
StreamingInsertJobOffsetPersistenceTest 27).
   - Not run on the rebased master: full streaming end-to-end regression suites 
and CI FE-to-runner connectivity for the SSL certificate HTTP fixtures.
   
   ### Release note
   
   Streaming CDC no longer requires source JDBC driver URL/class properties. 
Initial schemas, `cdc_stream`, and added columns now use consistent type 
mapping: PostgreSQL UUID maps to STRING, JSON/JSONB to JSON, and JSON arrays to 
ARRAY<STRING>. PostgreSQL numerics without a representable DECIMAL 
precision/scale map to STRING; numeric NaN and positive/negative infinity 
become NULL. Multidimensional PostgreSQL arrays are explicitly rejected. 
Unspecified temporal precision defaults to 0 for MySQL and 6 for PostgreSQL. 
Jobs using the rejected MySQL JDBC options must remove them before creation, 
update, or restart.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details and Release note)
   - Does this need documentation: Yes (update streaming CDC driver 
requirements and source type mappings)
   - Pre-submission status: Partially verified: streaming end-to-end suites and 
SSL CI connectivity remain unverified; build, style checks, targeted UTs and 
schema ITs passed on the Byte development machine.
   
   ### AI Disclosure
   
   - Tool: Codex, GPT-6 family models
   - Generated: implementation, tests, PR title and description
   - Human review: maintainer review pending
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to