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

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #64304
   
   Problem Summary:
   
   Follow-up cleanup for #64304. After external catalogs moved behind the 
connector plugin SPI, fe-core still declared a name for every data source it no 
longer knows anything about. This removes those names:
   
   - **`TableIf.TableType`**: the per-source `*_EXTERNAL_TABLE` constants 
(`HMS`, `ES`, `JDBC`, `ICEBERG`, `PAIMON`, `MAX_COMPUTE`, `HUDI`, 
`TRINO_CONNECTOR`, `LAKESOUl`) and the deprecated internal-catalog `ICEBERG` / 
`HUDI`. An external table served by a connector plugin is a 
`PLUGIN_EXTERNAL_TABLE`; the source's own name is answered by 
`PluginDrivenExternalCatalog#getDisplayEngineName`, never by a mapping held in 
fe-core.
   - **`TableFormatType`**: `hive`, `iceberg`, `hudi`, `paimon`, `max_compute`, 
`transactional_hive`, `lakesoul`, `trino_connector`. A connector names its own 
format string through `ConnectorScanRange#getTableFormatType()`, which 
`PluginDrivenScanNode` forwards to BE verbatim. Only `tvf` and `remote_doris` 
are still produced by fe-core itself. The enum is not persisted anywhere — it 
only builds the thrift string.
   - **`InitDatabaseLog.Type`**, and with it `ExternalDatabase#dbLogType`, a 
field that was assigned and never read. `OP_INIT_EXTERNAL_DB` has been ignored 
on replay since 4.0 and `EditLog#logInitExternalDb` has no callers, so nothing 
writes one any more; the payload class stays only so `JournalEntity` can still 
consume such an entry out of an old journal.
   - **`InitCatalogLog.Type.HUDI`**, which was never produced: hudi tables have 
always lived in an hms catalog and no `HudiExternalCatalog` ever existed.
   - **`Database#discardHudiTable`**, dead once `TableType.HUDI` is gone.
   
   The remaining `InitCatalogLog.Type` values are kept on purpose. That enum is 
also the type of the persisted `ExternalCatalog#logType` field, which 
`PluginDrivenExternalCatalog#gsonPostProcess` reads to backfill the catalog 
type for the resource-backed catalogs (`es`, `jdbc`) that never persisted one. 
Deleting a name there would make it deserialize to `null` and lose that 
catalog's type on upgrade.
   
   **Upgrade compatibility.** An image written before the cutover still carries 
the old `TableType` names. It stays readable because the persisted table class 
is remapped by `GsonUtils`' compatible-subtype registry, and the stale `type` 
string deserializes to `null` — GSON returns `null` for an enum name it does 
not know rather than throwing — which 
`PluginDrivenExternalTable#gsonPostProcess` then normalizes to 
`PLUGIN_EXTERNAL_TABLE`, the same normalization it already applied to a 
recognized legacy name.
   
   Nothing in the compiler enforces that two-step property, and a regression 
would surface not as a build error but as an FE replaying a persisted external 
table with a `null` type. So the new `LegacyExternalTableTypeReplayTest` pins 
it for every deleted name, deliberately spelled as string literals so the 
constants cannot come back just to keep a test compiling.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [x] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   


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