Gabriel39 opened a new pull request, #69946:
URL: https://github.com/apache/doris/pull/69946
### What problem does this PR solve?
Related PR: #69836
Selecting an external Iceberg REST view can fail during query binding with
`BadRequestException: ... is not an Iceberg compatible table`, even when the
catalog supports reading the view definition.
`BindRelation` loads statement snapshots before expanding the view SQL. The
snapshot loader calls `PluginDrivenExternalTable.resolveConnectorTableHandle`,
which unconditionally asks the connector for a table handle using the view
name. A REST catalog can reject that table request with HTTP 400 instead of
reporting a missing table. The Iceberg connector only converts
`NoSuchTableException` to an empty handle, so the error escapes before the
existing view-existence fallback can run.
Resolve the object's view classification before requesting a table handle.
Known views return no table handle and retain the live view-existence check, so
a view deleted outside Doris still invalidates its cached lookup. Snapshot
loading can then return an empty view pin and continue to view expansion; the
referenced base tables keep their normal snapshot handling. Ordinary table
handles and table-load errors retain their existing behavior.
This addresses the shared handle-resolution boundary, including callers
outside the snapshot loader. #69836 proposes skipping the snapshot-loader entry
instead.
### Release note
Fix external view queries failing when an Iceberg REST catalog rejects table
metadata requests for view names.
### Check List (For Author)
- Test
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test
- [ ] No need to test or manual test.
- Behavior changed:
- [ ] No.
- [x] Yes. External views no longer issue a table-handle request during
resolution.
- Does this need documentation?
- [x] No.
- [ ] Yes.
Validation:
- `run-fe-ut.sh --run` with `PluginDrivenExternalViewHandleTest`,
`PluginDrivenExternalTableTest`, `PluginDrivenMvccExternalTableTest`, and
`PluginDrivenMissingTableTest`: **164 tests passed**, with no failures, errors,
or skips.
- Before the fix, both view cases failed with the reproduced table-endpoint
error; the ordinary table cases passed.
- `mvn checkstyle:check -pl fe-core`: **0 violations**.
- `git diff --check` passed.
No live Databricks integration test was run.
--
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]