You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "laserninja (via GitHub)" <gi...@apache.org> on 2026/04/12 02:19:47 UTC

[I] REST: Add ETag and conditional GET support for loadView [iceberg]

laserninja opened a new issue, #15946:
URL: https://github.com/apache/iceberg/issues/15946

   ### Proposed Change
   
   
   The `loadTable` endpoint (`GET /v1/{prefix}/namespaces/{namespace}/tables/{table}`) supports conditional requests via the `If-None-Match` request header and returns an `ETag` response header (spec lines 965–977). When the table metadata hasn't changed, the server returns `304 Not Modified`, saving serialization and transfer costs. The Java reference client (`RESTSessionCatalog`) implements this with a Caffeine-backed `RESTTableCache` that stores `(sessionId, TableIdentifier) → (table, eTag)` mappings.
   
   However, the `loadView` endpoint (`GET /v1/{prefix}/namespaces/{namespace}/views/{view}`) has **no equivalent support**:
   
   1. **Spec gap:** The `loadView` operation ([rest-catalog-open-api.yaml, line ~1580](https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml#L1580)) defines no `If-None-Match` header parameter and no `304` response. The `LoadViewResponse` response object (line ~4953) has no `etag` header, whereas `LoadTableResponse` (line ~4943) and `CommitTableResponse` (line ~4974) both include one.
   
   2. **Client gap:** `RESTSessionCatalog.loadView()` (line ~1427 in RESTSessionCatalog.java) always issues a full `GET` with no headers and no caching. There is no `RESTViewCache` equivalent to the existing `RESTTableCache`.
   
   Views are increasingly used for cross-engine SQL compatibility layers and can have substantial metadata (multiple version entries, representations, schema history). Workloads that repeatedly resolve or validate views pay the full round-trip cost every time.
   
   **Proposed spec changes:**
   
   - Add an optional `If-None-Match` header parameter to the `loadView` GET operation, matching the existing pattern on `loadTable`.
   - Add a `304 Not Modified` response to the `loadView` GET operation.
   - Add an `etag` response header to `LoadViewResponse`, matching `LoadTableResponse` and `CommitTableResponse`.
   - Optionally add an `etag` response header to the `replaceView` (`POST`) response, matching `commitTable`, so the cache can be primed on writes.
   
   **Backward compatibility:**
   
   - `If-None-Match` is an optional header; servers that don't support it simply ignore it and return `200` as today.
   - Clients that don't send the header see no behavioral change.
   
   
   ### Proposal document
   
   _No response_
   
   ### Specifications
   
   - [ ] Table
   - [x] View
   - [x] REST
   - [ ] Puffin
   - [ ] Encryption
   - [ ] Other


-- 
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: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] REST: Add ETag and conditional GET support for loadView [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #15946:
URL: https://github.com/apache/iceberg/issues/15946#issuecomment-6091620774

   This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org