geyanggang opened a new pull request, #11286:
URL: https://github.com/apache/gravitino/pull/11286

   
   
   ### What changes were proposed in this pull request?
   
   Catch `ForbiddenException` in the Flink connector's table lookup methods and 
treat it as "table not exist":
   
   - `BaseCatalog.getTable()` — throw `TableNotExistException` on 
`ForbiddenException`
   - `BaseCatalog.tableExists()` — return `false` on `ForbiddenException`
   - `GravitinoHiveCatalog.getTable()` — throw `TableNotExistException` on 
`ForbiddenException`
   
   
   ### Why are the changes needed?
   
   When Flink Calcite resolves two-part SQL identifiers (e.g., `schema.table`), 
it speculatively calls `loadTable` with different namespace combinations. If 
the probed table does not exist, the authorization interceptor returns 403 
before the method can return 404. This blocks Calcite's fallback resolution and 
causes SQL validation failures.
   
   Authorization should not apply to non-existent resources. Returning 403 for 
a non-existent table is misleading and breaks Flink Calcite's standard 
identifier resolution.
   
   
   Fix: #11130 
   
   ### Does this PR introduce _any_ user-facing change?
   
   No API changes. Users with authorization enabled will no longer see 
`ForbiddenException` when Flink Calcite speculatively probes non-existent 
tables during SQL parsing.
   
   
   ### How was this patch tested?
   
   Existing unit tests pass. The fix was verified in a production environment 
with authorization enabled — two-part identifier queries (e.g., `SELECT * FROM 
schema.table`) now resolve correctly without requiring three-part references.


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

Reply via email to