sakshichitnis27 opened a new pull request, #18665:
URL: https://github.com/apache/iceberg/pull/18665

   `RESTSessionCatalog`'s `replaceTransaction()` checked `viewExists()` before 
loading the table, so `CREATE OR REPLACE TABLE` failed with 
`ForbiddenException` for callers that can use tables but not views, even when 
the table exists. This loads the table first and only checks for a same-named 
view when the table doesn't exist. A 403 on that check is treated as "no view", 
so `createOrReplaceTransaction()` can still fall back to create. A same-named 
view still gives `AlreadyExistsException`. How `view-endpoints-supported` is 
handled is unchanged.
   
   Fixes #18662
   
   Test plan: four tests in `TestRESTCatalog` with view requests returning 403 
(replace and create-or-replace of an existing table, create-or-replace of a new 
table, replace of a missing table). All four fail on the current default branch 
and pass with this change. `./gradlew :iceberg-core:test --tests 
'org.apache.iceberg.rest.*'`, `spotlessCheck`, and 
`checkstyleMain`/`checkstyleTest` for `iceberg-core` pass.
   
   ---
   **AI Disclosure**
   - Model: Claude Sonnet 5.5
   - Platform/Tool: Claude Code
   - Human Oversight: [unknown - human to fill in]
   - Prompt Summary: Fix issue #18662; the code change in `RESTSessionCatalog` 
and the tests in `TestRESTCatalog` were generated by the agent, and the author 
runs and reviews them.
   


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