Skip to content

[Feature][Iceberg] Support native V3 encrypted reads through REST catalogs #71009

In review

Description

@Gabriel39

Background

Doris already has Iceberg REST encrypted-metadata/KMS support and native Hive Metastore (HMS) V3 Parquet Modular Encryption (PME) reads over protected private RPC. Users of REST catalogs need the same native SQL read capability.

Current behavior

At master commit 0d16233, the common encrypted-read admission path accepts HMS and REST initially but then rejects REST with Iceberg encryption [UNSUPPORTED_CATALOG]: Native encrypted Iceberg execution currently requires HMS, even after the engine verifies native readers and protected transport.

Expected behavior

An explicitly enabled REST catalog exposing a standard-encrypted Iceberg V3 table should return the same rows, delete application, historical snapshots and physical COUNT results as HMS. Missing execution prerequisites must still fail before publishing file keys.

Proposed design

Remove the final HMS-only restriction after the existing HMS/REST allowlist, V3 check, standard-manager check and verified native/transport admission. Reuse the established per-file key/AAD descriptors and native Parquet reader. Exercise the real HTTP REST connector in unit tests and expose the existing independent-key physical fixtures through the read-only REST test service for SQL regression coverage.

The native prerequisite also shares candidate backend membership with encryption admission. Each round-robin scan now selects its own starting cursor within that membership, avoiding a hotspot when a statement contains many one-split scans. Explicit load ordering retains its cursor reset. This addresses the review in #70697 (comment).

A separate REST-specific encryption reader or wire format would duplicate the existing standard encryption path without providing a different file contract. No new SPI version, Thrift field or deployment switch is needed. This issue records the implementation proposal; it does not assert prior community design approval.

Impact

REST catalog users can opt in to native encrypted V3 reads. The deployment switch remains disabled by default, and ordinary plaintext reads retain their existing behavior. Planned documentation support version: 5.0.

Reproduction or evidence

The existing IcebergEncryptionRead.check contains the final HMS-only rejection. Focused unit tests reproduce that restriction through native planning and the actual HTTP REST connector. The proposed SQL matrix compares HMS and REST against the same SDK/Spark reference fixtures.

Scope and non-goals

Support standard-encrypted V3 Parquet AES_GCM_V1 data, position deletes and equality deletes, including independent file keys and SDK-encrypted manifests/lists. Encrypted V4, encrypted writes/maintenance, ORC/Puffin encryption and JNI metadata-table execution are outside this issue.

Acceptance criteria

  • Real REST metadata loads produce native PME scan ranges with the writer's file keys and AAD.
  • Current matching FE/BE binaries execute SQL for snapshots, deletes, filtering, aggregation, joins and physical COUNT.
  • Table/result-cache settings do not bypass warm-query KMS revocation; restoring permission permits subsequent reads.
  • A SELECT-only user can query the granted table and cannot query an ungranted namespace.
  • Default-off, unsupported-format, missing-capability, encrypted-write and JNI metadata-table checks remain enforced.
  • Unit and reproducible regression coverage accompany the implementation.
  • Shared candidate membership is sampled once per statement, while independent round-robin scans spread their starting positions; explicit load ordering is retained.

Risks and compatibility

No persisted table data, storage format or RPC contract changes. Execution continues to require matching capable packages and protected private RPC; a deployment missing that proof fails closed. Existing external metadata and retained historical keys remain authoritative. SDK-compatible mock KMS tests do not establish live-provider IAM acceptance.

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions