[refactor](fe) Remove the JDBC data-source implementation from fe-core; serve it from fe-connector-jdbc - #68037
Open
morningman wants to merge 4 commits into
Open
morningman wants to merge 4 commits into
morningman wants to merge 4 commits into
Conversation
morningman
requested review from
924060929,
CalvinKirs,
englefly,
morrySnow and
starocean999
as code owners
September 15, 2026 19:07
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
Author
|
/review |
Contributor
|
Codex automated review failed and did not complete. Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Sep 19th, 2026 8:24 AM. The selected account is excluded until 2026-09-19T08:24:00Z. Please trigger /review again; another configured account may be available. |
… and add getPrimaryKeys/executeQuery Issue Number: close #xxx Related PR: #xxx Problem Summary: Part 1 of removing every JDBC data-source implementation from fe-core: the connector SPI grows what the streaming/CDC framework needs from a JDBC source, and the driver-jar policy stops being an engine service. - `ConnectorTableMetadataOps.getPrimaryKeys` (a JDBC table answers `isKey` for every column, so the real constraint needs its own method) and `ConnectorPassthroughSqlOps.executeQuery(session, sql, params)` with the `ConnectorQueryResult` value type; parameters bind positionally so a name a caller took from user input never becomes SQL text. - `ConnectorValidationContext` loses `validateAndResolveDriverPath` and `computeDriverChecksum`. The whole policy (url grammar, url white list, structural secure-path matching, bare-name resolution across the current and pre-2.1 drivers directories, checksum) moves to `DriverUrlPolicy` in fe-connector-spi, applied by the jdbc, iceberg and paimon connectors themselves; fe.conf's `jdbc_driver_secure_path` / `jdbc_driver_url_white_list` reach it through the engine environment. The only engine service left is `ConnectorContext.fetchPluginFile`, the cloud deployment's object-store copy of a missing driver jar. - The jdbc connector applies the policy at load time as well as at CREATE (the pre-SPI `JdbcClient` did too), so a catalog whose driver sits outside a since-tightened allow-list fails to connect instead of loading the jar. - Three fixes that had only landed in the fe-core client are ported to the connector clients: composite primary keys ordered by KEY_SEQ (apache#64740), the PostgreSQL neighbour-table column leak through LIKE wildcards (apache#63402), and PostgreSQL array element types (apache#61433; `bpchar[]` elements are STRING). - Plugin API version 8.0 -> 9.0, both surface baselines regenerated. A JDBC catalog now applies `jdbc_driver_secure_path` / `jdbc_driver_url_white_list` when it loads its driver, not only when it is created. PostgreSQL `char(n)[]` columns of a JDBC catalog map to `ARRAY<STRING>` again instead of `ARRAY<CHAR(n)>`. - Test: Unit Test - fe-connector-spi suite (incl. new DriverUrlPolicyTest), fe-connector-jdbc suite (new PostgreSQL/OceanBase/base-client tests, pre-create validation and load-time policy tests), fe-connector-paimon and fe-connector-iceberg suites. - Behavior changed: Yes (see release note) - Does this need documentation: No Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…tor SPI and delete the fe-core JDBC clients
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Part 2: the streaming/CDC framework was the last user of the fe-core copy of
the JDBC dialect clients (`datasource/jdbc/client/*`, 13 classes and ~3000
lines that duplicated fe-connector-jdbc and had drifted from it). It now goes
through the same connector plugin a JDBC catalog uses:
- `StreamingSourceClient` (fe-core, `job/util`) opens a temporary connector via
`ConnectorFactory` with the job's own source properties, acquires metadata
through the `PluginDrivenMetadata` funnel, converts the connector schema with
`ConnectorColumnConverter`, and runs the framework's probe queries through
`executeQuery`. The four call sites (`generateCreateTableCmds`, the
`cdc_stream` TVF, the OceanBase compatibility-mode check and the PostgreSQL
slot/publication validator) keep their logic; only the client changes.
- The fe-core clients, `JdbcFieldSchema` and their six tests are deleted;
`JdbcClientException.getAllExceptionMessages` becomes `Util.getAllExceptionMessages`.
- A streaming job now needs the jdbc connector plugin (bundled by default) and
fails with a clear message without it.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- StreamingSourceClientTest (new), StreamingJobUtilsTest,
DataSourceConfigValidatorTest, CdcStreamTableValuedFunctionTest,
PostgresResourceValidatorTest (four new cases), UtilTest.
- Behavior changed: Yes. The FE-side metadata connection of a streaming job is
built by the connector, whose URL normalization forces `tinyInt1isBit=false`
and `yearIsDateType=false`; the job's persisted URL and the BE CDC reader are
unchanged. PostgreSQL array columns whose element type the old client
rejected now map to `ARRAY<STRING>`, as the CDC client already did.
- Does this need documentation: No
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…and drop dead JDBC plan/rule types
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Part 3: `JdbcResource` carried the last JDBC logic in fe-core — url
normalization, dialect constants, driver-jar resolution, white list, secure
path, checksum and cloud download — although a resource no longer backs
anything (`CREATE CATALOG ... WITH RESOURCE` is disallowed by default and reads
nothing from a JDBC resource). It is now a `@Deprecated` shell: the Gson tag,
the persisted `configs` field, the property list and defaults and the
`SHOW RESOURCES` rows are unchanged, `CREATE RESOURCE type=jdbc` keeps working,
and property validation plus the driver checksum are done by the jdbc connector
plugin exactly as for a JDBC catalog. The stored `jdbc_url` is no longer
rewritten.
Also removed: the empty `JdbcTransactionManager`, the unreferenced
`LOGICAL/PHYSICAL_JDBC_*` `PlanType` values and `*_JDBC_*` `RuleType` values,
and the `"jdbc"` source-name gate around the schema-load debug point in
`PluginDrivenExternalTable` (the debug point now applies to any plugin table).
### Release note
`CREATE RESOURCE ... type=jdbc` is deprecated; use `CREATE CATALOG ...
"type"="jdbc"`. It keeps working, validated by the jdbc connector plugin, and
`SHOW RESOURCES` shows the `jdbc_url` as written instead of a normalized form.
### Check List (For Author)
- Test: Unit Test
- JdbcResourceTest (rewritten for the shell: defaults, replay, row count,
connector validation, missing plugin, password masking),
GrantResourcePrivilegeCommandTest, RevokeResourcePrivilegeCommandTest,
CreateResourceCommandTest, PluginDrivenInsertExecutorTest.
- Behavior changed: Yes (see release note)
- Does this need documentation: Yes (deprecate CREATE RESOURCE type=jdbc)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… HikariCP dependency
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Part 4: keep the JDBC implementation from drifting back into fe-core.
`build-support/check-fe-core-jdbc-free.sh` runs in fe-core's `validate` phase
next to the metadata-funnel gate and fails the build on an import of
`org.apache.doris.datasource.jdbc.*`, `com.zaxxer.hikari.*` or a `java.sql`
connection/statement type in fe-core main sources; `httpv2/` (the FE's HTTP SQL
gateway, JDBC to the FE itself) is the only exemption. Self-test in
`build-support/tests/`. fe-core's HikariCP dependency goes with the deleted
clients (the plugin bundles its own), and the fe-connector docs list the new
gate.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- build-support/tests/run.sh (all gate self-tests), fe-core validate phase.
- Behavior changed: No
- Does this need documentation: No
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
morningman
force-pushed
the
wt-remove-jdbc-fe-core
branch
from
September 15, 2026 23:45
e60bc62 to
5dbcecc
Compare
Contributor
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 16913 ms |
Contributor
TPC-DS: Total hot run time: 83633 ms |
Contributor
ClickBench: Total hot run time: 14.78 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #67916 (the same SQL Server type-mapping fix had to be made twice, once per copy)
Problem Summary:
fe-core still carried a full copy of the JDBC data-source implementation next to the
fe-connector-jdbc plugin: 13 dialect clients with their own type mappings
(
datasource/jdbc/client/*, ~3000 lines), the driver-jar policy and url normalizationinside
JdbcResource, and an engine hook (ConnectorValidationContext .validateAndResolveDriverPath/computeDriverChecksum) that lent that policy to plugins.The only production user of the fe-core clients was the streaming/CDC framework, and the
two copies had drifted: three streaming-driven fixes (#64740 composite PK order, #63402
PostgreSQL neighbour-table leak, #61433 PostgreSQL array types) never reached the
connector, and #67916 had to patch both.
After this PR fe-core has no JDBC implementation; what remains is generic SPI use plus
two
@Deprecatedpersistence shells (JdbcResource,JdbcTable).ConnectorTableMetadataOps.getPrimaryKeys,ConnectorPassthroughSqlOps.executeQuery(session, sql, params)+ConnectorQueryResult,ConnectorContext.fetchPluginFile(a cloud deployment'sobject-store copy of a missing plugin file);
ConnectorValidationContextloses its twodriver methods.
DriverUrlPolicy(fe-connector-spi) is the one driver-jar policy —url grammar,
jdbc_driver_url_white_list, structuraljdbc_driver_secure_pathmatching, bare-name resolution across the current and pre-2.1 drivers directories,
cloud fetch, checksum — applied by the jdbc, iceberg and paimon connectors.
DriverUrlPolicyat CREATE and at load; ports the three fixes above (KEY_SEQ ordering in the base
client, PostgreSQL exact schema/table filter,
bpchar[]elements as STRING).StreamingSourceClient(fe-core) opens a temporary connector throughConnectorFactorywith the job's source properties (same names as a JDBC catalog),goes through the
PluginDrivenMetadatafunnel andConnectorColumnConverter, andruns the framework's probe queries with bound parameters. The four call sites keep
their logic. The fe-core clients and their tests are deleted.
JdbcResource—@Deprecatedshell: Gson tag,configs, property list anddefaults,
SHOW RESOURCESrows unchanged; validation and the driver checksum comefrom the jdbc plugin. Dead
JdbcTransactionManagerand*_JDBC_*plan/rule typesremoved; the
"jdbc"gate around the schema-load debug point removed.build-support/check-fe-core-jdbc-free.sh(validate phase, self-tested)forbids
org.apache.doris.datasource.jdbc.*,com.zaxxer.hikari.*andjava.sqlconnection/statement imports in fe-core main sources (
httpv2/, JDBC to the FEitself, exempt). fe-core drops its HikariCP dependency.
Release note
jdbc_driver_secure_path/jdbc_driver_url_white_listwhen it loads its driver, not only at CREATE; a catalog whose driver sits outside a
since-tightened allow-list fails to connect instead of loading the jar.
CREATE RESOURCE ... type=jdbcis deprecated in favour ofCREATE CATALOG ... "type"="jdbc"; it keeps working andSHOW RESOURCESshowsjdbc_urlas written instead of a normalized form.metadata connection is built by the connector (its url normalization forces
tinyInt1isBit=false/yearIsDateType=false); the persisted job url and the BE CDCreader are unchanged. PostgreSQL array columns whose element type the old client
rejected now map to
ARRAY<STRING>(as the CDC client already did), empty tables nolonger fail array-dimension detection, and
char(n)[]maps toARRAY<STRING>inJDBC catalogs again.
Check List (For Author)
Test
Unit tests run locally: fe-connector-spi (164, incl. 23 new
DriverUrlPolicyTest),fe-connector-jdbc (240; new PostgreSQL/OceanBase/base-client tests, pre-create validation
and load-time policy tests), fe-connector-paimon (574), fe-connector-iceberg (1431, one
failure pre-existing on master:
IcebergWritePlanProviderTest .planMergePreservesExplicitlyEmptyReadAcrossConcurrentFirstAppend), the full fe-coresuite (10993 tests; the 12 failures in 10 classes are unrelated to this change and fail
identically on the base commit on the same machine),
build-support/tests/run.sh.Regression suites to watch in CI:
external_table_p0/jdbc,job_p0/streaming_job/cdc,query_p0/show/test_nereids_show_resources,manager/test_manager_interface_3,test_cloud_plugin_auto_download(cloud).Behavior changed:
Does this need documentation?
CREATE RESOURCE type=jdbc;note that the driver allow-lists are enforced when a JDBC catalog loads its driver.
Check List (For Reviewer who merge this PR)
🤖 Generated with Claude Code