Repository navigation
Commit 49bfbde
authored
[fix](fe) Avoid table handle lookups for external views (apache#69946)
### What problem does this PR solve?
Related PR: apache#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. apache#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.1 parent 44dfa15 commit 49bfbde
2 files changed
Lines changed: 115 additions & 1 deletion
File tree
- fe/fe-core/src
- main/java/org/apache/doris/datasource/plugin
- test/java/org/apache/doris/datasource/plugin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
0 commit comments