Gabriel39 opened a new pull request, #70869:
URL: https://github.com/apache/doris/pull/70869
### Background
Iceberg stores file lists in manifests, which Doris reads in FE planning and
in the BE metadata JNI plugin. The released Iceberg 1.12 SDK supports format v4
tables with Parquet manifests and table-relative file locations. Older
snapshots can retain Avro manifests and existing delete files after an upgrade.
### What problem does this PR solve?
Issue Number: close #70868
Related PR: None
PR Type: Feature
Problem Summary:
Users cannot read SDK 1.12 format v4 tables reliably when the isolated
runtime lacks Parquet manifest support, historical partition recovery assumes
Avro, or native reads receive unresolved relative paths. This adds plaintext V4
reads through existing catalogs while preserving logical file identities for
delete matching. Most of the diff is SDK-backed tests, real data/delete
fixtures and generated regression results; V1–V3 tables retain their existing
path handling.
### Details
- **Change map:** Production code +310/-23; tests and fixtures +751/-11;
generated output +489/-0; build configuration +55/-10; no documentation or
submodule changes. Production review order:
| Part | Changed lines | Purpose |
|---|---:|---|
| Runtime closures | 65 | Package Parquet and its required MapReduce
classes in both Java runtimes |
| Manifest headers | 58 | Recover partition schemas from the actual Avro
header or Parquet footer |
| Read views and physical paths | 249 | Freeze metadata with its base
location; resolve physical paths while retaining raw delete identities |
| Manifest cache identity | 26 | Separate identical relative manifest
names belonging to different tables |
- **Scope:** Plaintext V4 reads produced by SDK 1.12, using data types and
data-file formats already supported by Doris; FE planning and BE metadata
scans. Encrypted V4 reads, write support and unreleased root/leaf metadata APIs
are outside this change.
- **Design:** A borrowed serializable FileIO view binds relative metadata
reads to one metadata generation. Native physical paths resolve separately from
logical identities; retained Avro entries use their producing manifest's
version. A bounded transient cache stores those version numbers. Adding
dependencies alone cannot fix native paths or historical partition recovery.
Proposed in #70868, opened with this PR; no prior design discussion.
- **Usage:** Point an existing Iceberg catalog at a supported V4 table, then
use ordinary SQL:
```sql
SELECT * FROM iceberg_lake.analytics.sample_table LIMIT 10;
SELECT record_count FROM iceberg_lake.analytics.`sample_table$files`;
```
- **Default behavior:** Automatic for format version 4; no new options or
changes to cache defaults.
- **Compatibility:** Update both FE and BE Java packages before querying V4
metadata tables: older plugins cannot deserialize the new adapter. Existing
V1–V3 reads bypass the V4 view. No Thrift, EditLog, image or catalog-property
format changes; V4 reads require the new packages after a downgrade.
- **Security and privileges:** Existing catalog and SELECT privileges and
the original storage FileIO remain in force. The adapter borrows catalog
clients and does not close them. There is no new endpoint or remote artifact
option.
### Testing
- Locally, `run-fe-ut.sh` passed 535 tests across connector planning,
manifest caching, path/serialization behavior and the metadata JNI plugin.
Includes real Parquet and Avro V4 manifests, expired partition schemas, missing
base locations, cross-table cache isolation and inherited deletes.
- The baseline SDK-backed test failed with unregistered `PARQUET`.
Temporarily disabling the header/cache corrections made the targeted tests fail
with an Avro magic error and the wrong table's file; the corrections were
restored before the passing run.
- Locally, `test_iceberg_v4_read` generated 80 SQL result blocks on the
current FE and ASAN BE. Every block matched independently derived fixture
rows/counts. Covers fresh and relative V4 tables, V2/V3 upgrades, real Puffin
vectors, retained position/equality deletes, JNI `$files`, cache and batch
modes, warm reads and COUNT pushdown. A second normal comparison run passed all
80 queries against that generated output.
- Live S3 keys with doubled separators were not tested end to end: the local
object store rejects those keys. Unit tests verify literal separator
preservation and producing-version path rules.
### Notes for Reviewers
The FE test classpath puts the SDK's Parquet classes before provided FE
Thrift classes, matching deployed child-first plugin loading. MapReduce
transitives are excluded because filesystem dependencies are already declared
separately.
### Release note
Doris can read supported plaintext Iceberg format v4 tables produced by SDK
1.12, including Parquet manifests, relative paths and retained deletes after
table upgrades. Update both FE and BE packages before using this capability.
### Check List (For Author)
- Behavior changed: No
- Does this need documentation: Yes (update Iceberg catalog compatibility
documentation in apache/doris-website with the SDK 1.12 read scope and FE/BE
upgrade requirement).
- Pre-submission status: Partially verified: live S3 doubled-separator keys
remain unverified; literal path semantics are covered by unit tests.
### AI Disclosure
- Tool: Codex (GPT-6)
- Generated: implementation, tests, fixtures and this description.
- Human review: not stated.
- Prompts: Implement V4 read compatibility on master with unit and
regression coverage. Target the released SDK rather than unreleased
metadata-tree APIs.
--
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]