Skip to content

[refactor](external) Remove Hive ACID, Avro and LakeSoul readers on branch-4.2 - #69312

Closed
Gabriel39 wants to merge 1 commit into
apache:branch-4.2from
Gabriel39:dev/remove-legacy-external-readers-4.2
Closed

Gabriel39 wants to merge 1 commit into
apache:branch-4.2from
Gabriel39:dev/remove-legacy-external-readers-4.2

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

branch-4.2 still contains Hive transactional, standalone Avro, and LakeSoul readers that are no longer supported. Remove their implementations, dependencies, packaging, examples, and related regression tests.

  • Remove Hive ACID transaction/lock management, valid-write-ID and delta-file enumeration, the transactional reader, and ACID-specific ORC decoding and delete filtering. Reject both full ACID and insert-only transactional tables.
  • Remove the standalone Avro JNI reader and Java scanner, plus LakeSoul catalog metadata classes, planning, JNI readers, and Java scanners.
  • Reject deprecated scan formats before reading files or applying metadata-only count optimizations.
  • Preserve all Thrift definitions and numeric identifiers, with explicit deprecation comments.
  • Preserve Iceberg manifest/manifest-list Avro parsing and the Avro dependencies needed by Iceberg and Hudi. Iceberg data-file scanning already accepts only Parquet and ORC on this branch.

Release note

Remove support for Hive transactional table reads, standalone Avro file reads, and LakeSoul. Existing LakeSoul catalog metadata is no longer deserializable; remove LakeSoul catalogs before upgrading. Iceberg Avro metadata files remain supported.

Validation

  • FE reactor compilation and 65 targeted unit tests passed, including rejection tests, ordinary Hive scan planning, HMS client lifecycle, partition path parsing, and insert failure cleanup.
  • Repository FE Checkstyle passed with zero violations.
  • Clang 20 syntax-only compilation passed for all 10 changed BE production translation units and all 5 changed BE test translation units, using generated headers and configured dependency includes. Full BE linking and test execution remain for CI.
  • All 19 affected C++ source/header files passed clang-format 16.
  • Modified build/Docker shell scripts passed bash -n; git diff --check passed.
  • Verified that all Thrift changes are comments only.

Check List (For Author)

  • Unit tests
  • Behavior changed as described above
  • Release note included

@Gabriel39
Gabriel39 requested a review from yiguolei as a code owner October 20, 2026 02:47
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes for one P1 recovery bug: after a successful pre-upgrade LakeSoul DROP, an older catalog image can still prevent FE startup before the committed drop is replayed. This is distinct from the declared removal of LakeSoul read support and incompatibility of catalogs intentionally left present.

Reviewed all 143 changed paths at 518be1a, using two reviewers covering the full diff and a separate reviewer for the three initial risks. No existing inline findings were present, including at live pre-submission readback; no additional user focus was supplied.

Critical checkpoint conclusions:

  1. Goal and proof: removed readers are deleted and new FE/BE unit cases cover explicit rejection, including full ACID and insert-only Hive. The dropped-catalog image recovery case is missing and exposes the P1.
  2. Scope: implementation, callers, dependencies, packaging, fixtures and examples are consistently removed; no unrelated production behavior change was substantiated.
  3. Concurrency: existing metadata synchronization and asynchronous split/cache structure remain; no new lock order, heavy locked operation or shared-state race was found. Checkpoint timing is relevant to the P1.
  4. Lifecycle/static initialization: removed Hive query transaction and JNI reader owners have no surviving consumers; ordinary reader cleanup and Hudi lifecycle remain. No new static initialization dependency was introduced.
  5. Configuration: no new setting; the obsolete ACID session flag is removed, with retained session/global variable readers tolerating absent fields.
  6. Compatibility: protocol symbols remain; persisted LakeSoul subtype removal has the reported recovery flaw even after the documented catalog drop.
  7. Thrift: every touched definition was compared with HEAD, branch-3.1, branch-4.0, branch-4.1, branch-4.2 and master. Changes are comments only; IDs, meanings and optional fields are preserved.
  8. Parallel paths: legacy/V2 scanners, lazy ranges, metadata counts, rowid fetch, schema RPC, Hive/Hudi/Iceberg/Paimon wrappers and legacy/Nereids load callers were traced. Surviving ORC decoding and position/equality-delete paths retain the former non-ACID behavior. Iceberg Avro metadata parsing and required Avro dependencies remain.
  9. Conditions: removed-format guards document transaction/merge semantics and fail explicitly before file readers or count shortcuts; ordinary Hive path/null parsing remains equivalent.
  10. Test coverage: inspected new negative tests and adjusted surviving tests. No regression covers image-before-DROP replay; retained connector runtime behavior was assessed statically.
  11. Expected results: obsolete ORC output labels are deleted with their queries; no new expected output values were introduced.
  12. Observability: unsupported requests fail with explicit diagnostics; no new operational path requiring metrics was found.
  13. Persistence/failover: image loading precedes journal replay and exposes the P1. Deprecated init-catalog/database journal records are already ignored on this branch; historical CREATE rejection predates this PR.
  14. Data writes/atomicity: no new data-write or commit path; supported external write transaction managers remain independent. The reported committed metadata drop cannot be recovered from an older image.
  15. FE/BE variables: no new transmitted variables; deprecated wire structures and IDs remain intact.
  16. Performance/memory: guards do constant-size setup checks; removed ACID branches simplify ORC processing. No new untracked allocation or retained-file-cache growth was found.
  17. Further sweep: deleted symbol/module/fixture searches and upstream/downstream rechecks produced no second verified finding.

Validation is static only: no builds, tests, source changes or submodule initialization were performed. Runtime recovery and connector execution remain for CI or a dedicated test environment.

Review converged in 2 rounds: all three reviewers returned NO_NEW_VALUABLE_FINDINGS on the unchanged single finding; all candidates and initial risks have evidence-backed dispositions and no unresolved static coverage gaps remain. The P1 requires changes despite review convergence.

Review converged after 2 round(s).

.registerSubtype(
TrinoConnectorExternalCatalog.class, TrinoConnectorExternalCatalog.class.getSimpleName())
.registerSubtype(LakeSoulExternalCatalog.class, LakeSoulExternalCatalog.class.getSimpleName())
.registerSubtype(LanceExternalCatalog.class, LanceExternalCatalog.class.getSimpleName())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Keep old catalog images readable until DROP replay

A successful DROP CATALOG before upgrading does not guarantee that the latest image no longer contains the LakeSoul catalog: CatalogMgr.dropCatalog() removes the live entry and journals the drop, while checkpoints run asynchronously. If the last image predates that drop, startup calls Env.loadImage() before opening/replaying the edit log, and removing this subtype makes RuntimeTypeAdapterFactory.read() throw on LakeSoulExternalCatalog. The FE therefore cannot start or replay the already-committed drop, even when the operator followed the release note. Keep a metadata-only deserialization path, including nested LakeSoul metadata, so startup can replay dropped catalogs without retaining LakeSoul read support.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 59.46% (22/37) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 75.93% (41/54) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 64.09% (29703/46348)
Line Coverage 48.96% (313150/639645)
Region Coverage 44.73% (251789/562877)
Branch Coverage 46.44% (118828/255858)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 85.19% (46/54) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.36% (34375/45019)
Line Coverage 61.19% (388140/634320)
Region Coverage 57.93% (326627/563862)
Branch Coverage 58.98% (150754/255598)

Gabriel39 added a commit that referenced this pull request Oct 26, 2026
…69333)

### What problem does this PR solve?

Add `LoadTableReader` so supported traditional file loads use
FileScannerV2 with the existing FE/Thrift source and destination tuples.
Source defaults, pre-filters, destination conversion, strict/nullability
checks, and flexible partial-update bitmaps run in the table-reader
finalization hook. CSV/JSON malformed records are rejected with rollback
and load counters. JSON pipes consume every message until EOF; empty
arrays and invalid configured roots contribute to the load quality gate
without losing valid siblings.

Master-specific adaptations:
- Preserve master's ADBC/Fluss V2 query selection and Lance exclusion.
- Match master's single-argument `TableReader::refresh_conjuncts()` and
`RowDescriptor` constructors, and use `SlotDescriptor::type()`.
- Omit the physical-split override and shared split-cache field, which
are absent on master. Loads retain the existing FE split boundaries.

Avro and Arrow IPC loads keep their existing path. No FE or Thrift
changes. This port is independent of #69312.

### Validation

- Passed the repository clang-format 16 check, covering all 17 changed
C++ source/header files.
- Passed `build-support/check-build-hygiene.sh` and `git diff --cached
--check`.
- Passed focused Clang syntax checks for all 11 changed C++ translation
units and `table_reader.cpp`, using this master's generated headers and
UT build configuration. The standalone scanner check suppresses two
pre-existing unused-constant warnings from master.
- Carried over the source PR's BE unit tests, JSON pipe tests, and
Stream Load regression fixtures.
- `run-be-ut.sh` completed configuration and started the full build. The
fresh build requires about 14,750 targets, so it was stopped and
replaced with the focused syntax checks above. No master runtime
unit-test or cluster-regression pass is claimed; full build and runtime
validation remain for CI.

### Release note

Route supported traditional file loads through FileScannerV2 with a
table reader for load conversion and validation.
Gabriel39 added a commit that referenced this pull request Oct 26, 2026
…69320)

### What problem does this PR solve?

Traditional file loads with source/destination tuples always select
FileScanner V1. Add `LoadTableReader` as a `TableReader` subclass so
supported loads can use FileScannerV2 without FE or Thrift changes.

`LoadTableReader::finalize_chunk()` uses base source materialization,
then applies per-record defaults, source pre-filters, destination
expressions, strict-mode conversion checks, nullability checks, and
flexible partial-update skip bitmaps and sequence-column marks.
`customize_file_scan_request()` enables malformed-record rejection. The
generic TableReader owns file and split lifecycle, with no load-specific
flag, branches, or presence-mask storage. Scanner continues to evaluate
destination conjuncts before ordinary output projections. Source readers
receive no destination predicate, aggregate pushdown, or condition-cache
snapshot. Missing physical source aliases fail before reader open unless
the FE default map declares a fallback; an explicit NULL default remains
valid, and path columns are exempt.

CSV/JSON readers reject malformed load records with row rollback and
error accounting. JSON reports field-presence masks separately from NULL
values so missing defaults and partial updates retain their meaning.
Empty outer arrays and array elements with missing or non-object
configured roots count as rejected load records so the existing
filter-ratio quality gate sees them. Valid siblings remain intact. Fully
rejected batches do not end a split. Non-line JSON streams consume each
pipe message until pipe EOF, including Kafka routine loads; chunked HTTP
buffers remain one document and regular file ranges retain
single-document behavior.

Supported load formats select V2 independently of the query session
option: the Thrift default does not distinguish an omitted option from
false in load plans. Query selection remains unchanged. Avro and Arrow
IPC stream loads keep their existing path; the current V2 Arrow
implementation only supports remote-Doris Flight scans. Load ranges keep
their FE split boundaries.

This PR targets `branch-4.2` and is independent of #69312.

### Validation

- Passed 28 targeted tests in a local ASAN/UBSAN harness, linking
rebuilt changed translation units against existing project libraries.
Coverage includes strict/non-strict conversion, pre-filter order,
explicit NULL versus missing defaults, non-nullability, flexible updates
and sequence marks, rejected-batch EOF, scanner selection, real CSV/JSON
readers through the load reader, missing physical sources versus
explicit NULL defaults and path columns, and ten JSON pipe cases:
multiple Kafka messages, batch boundaries, malformed messages,
fixed-length HTTP, chunked HTTP, empty pipe EOF, empty outer arrays,
missing/null roots, valid siblings around invalid roots, and fully
rejected root messages followed by valid messages. The harness also
executes two existing scanner-selector scenarios against the production
selector.
- Recompiled the changed BE implementation units and syntax-checked the
affected existing scanner, CSV, JSON, and TableReader test suites.
- Passed clang-format 16 checks for all 17 affected C++ source/header
files and `git diff --check`.
- Added parser unit tests and a Stream Load regression covering
target-column WHERE, rejected/unselected counts, JSON defaults, flexible
partial updates, and rejection of empty arrays or invalid configured
roots with max_filter_ratio=0 versus 1. Full BE build and cluster
regression execution remain for CI; they were not run locally.

### Release note

Route supported traditional file loads through FileScannerV2 with a
table reader for load conversion and validation.

### Check List (For Author)

- Test
  - [x] Regression test
  - [x] Unit Test
- Behavior changed:
- [x] Yes. Supported traditional loads select V2 independently of the
query-only session switch.
- Does this need documentation?
  - [x] Yes. Updated the in-repository FileScannerV2 design document.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Oct 26, 2026
…aster

### What problem does this PR solve?

Related PR: apache#69312

Problem Summary: Port the removal of unsupported external readers to master.
Adapt Hive transaction cleanup to the connector modules and preserve the
unified reader initialization interfaces. Reject deprecated reads before
file access or metadata-only count shortcuts, and remove obsolete fixtures
and examples. Preserve Iceberg and Hudi Avro metadata dependencies.

### Release note

Remove Hive transactional table reads, including insert-only tables, and
standalone Avro file reads. LakeSoul remains unsupported. Iceberg and Hudi
Avro metadata parsing is preserved. All Thrift definitions and IDs remain
unchanged.

### Check List (For Author)

- Test: Hive connector and HMS unit tests; targeted FE core unit tests;
  FE Checkstyle; clang-format 16; BE syntax checks; build hygiene;
  shell syntax and Thrift definition checks.
- Behavior changed: Yes, reject unsupported external reads explicitly.
- Does this need documentation: No, this ports the existing removal.

(cherry picked from commit 518be1a,
 adapted to master)
Gabriel39 added a commit that referenced this pull request Oct 27, 2026
…aster (#69601)

### What problem does this PR solve?

Related PR: #69312

Port #69312 from `branch-4.2` to current `master`.

- Remove Hive ACID read transactions, shared read locks, write-ID
snapshots, delta-file listing and the BE transactional reader. Reject
full ACID and insert-only reads in the Hive connector.
- Adapt the changes to master's connector modules and unified reader
initialization interfaces. Preserve ordinary Hive scanning and
Iceberg/Paimon ORC position-delete and deletion-vector handling.
- Reject standalone Avro and deprecated table markers before file access
or metadata-only counts. Keep LakeSoul unsupported and remove its
obsolete test service and examples.
- Keep the retired `skip_checking_acid_version_file` name as a
compatibility no-op for client session initialization, using the
existing empty-string fallback for variable reads.
- Preserve Iceberg/Hudi Avro metadata dependencies. The Thrift changes
add deprecation comments only; every definition and numeric ID is
unchanged.

### Release note

Remove support for Hive transactional reads, including insert-only
tables, and standalone Avro file reads. LakeSoul remains unsupported.
Iceberg and Hudi Avro metadata parsing remains supported. The retired
`skip_checking_acid_version_file` session variable remains accepted as a
compatibility no-op.

### Validation

- Hive connector: all 490 tests passed; HMS client: all 155 tests
passed.
- 20 targeted FE core tests passed: deprecated-read rejection,
partition-path parsing, generic file scan planning and Hive streaming
scans.
- Review follow-up: reproduced the legacy ACID session-variable failure
before the fix; all 8 focused compatibility, variable-export and
unsupported-read tests passed after the fix.
- FE Checkstyle passed with zero violations for every affected FE
module.
- All 12 affected C++ source/header files passed clang-format 16; build
hygiene and shell syntax checks passed.
- Syntax-only compilation passed for all 6 affected BE production
translation units and all 4 affected BE test translation units. Isolated
checks relaxed pre-existing unused-constant/shadow warnings. Full BE
linking and runtime tests remain for CI.
- Verified that Thrift changes are comments only and checked the
affected definitions against branch-3.1/4.0/4.1/4.2. `git diff --check`
passed.

### Check List (For Author)

- Test
    - [x] Unit Test
- [x] Manual test: formatting, syntax, build hygiene and Thrift
compatibility checks described above.
- Behavior changed:
    - [x] Yes. Reject unsupported external reads explicitly.
- Does this need documentation?
    - [x] No. This ports the existing removal to master.
@Gabriel39 Gabriel39 closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants