github-actions[bot] commented on code in PR #69501:
URL: https://github.com/apache/doris/pull/69501#discussion_r4357858293
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/plugin/PluginDrivenExternalTable.java:
##########
@@ -119,8 +119,22 @@ public PluginDrivenExternalTable(long id, String name,
String remoteName,
*/
public Optional<ConnectorTableHandle> resolveConnectorTableHandle(
ConnectorSession session, ConnectorMetadata metadata) {
+ PluginDrivenExternalCatalog owner = (PluginDrivenExternalCatalog)
catalog;
+ Connector connector = owner.getConnector();
+ ExternalDatabase<?> database = getDb();
+ Optional<Runnable> observation = database.observeTableLookup(this, ()
-> {
+ try {
+ connector.invalidateTable(db.getRemoteName(), getRemoteName());
+ } finally {
+ Env.getCurrentEnv().getExtMetaCacheMgr().invalidateTable(this);
+ }
+ });
String dbName = db != null ? db.getRemoteName() : "";
- return metadata.getTableHandle(session, dbName, getRemoteName());
+ Optional<ConnectorTableHandle> handle =
metadata.getTableHandle(session, dbName, getRemoteName());
+ if (!handle.isPresent()) {
+ observation.ifPresent(Runnable::run);
Review Comment:
[P2] Preserve healthy Iceberg views when a table handle is absent
A normal `SELECT * FROM iceberg_catalog.db.v` on an existing SDK view
reaches this branch: Iceberg advertises both MVCC and view support, so its
views use `PluginDrivenMvccExternalTable`, and `BindRelation.getLogicalPlan`
calls `StatementContext.loadSnapshots` before checking `isView()`.
`materializeLatest()` then calls this resolver. Iceberg's `tableExists()` is
false for views, so an empty table handle is expected here, as the separate
view path in `initSchema()` already documents. With warm names/object caches,
the new observation nevertheless removes the healthy view's object, ID and
schema/connector metadata and invalidates the entire database names snapshot.
Repeated view queries therefore force full table/view enumeration and rebuild
cached metadata even though nothing changed remotely. Exclude known views from
missing-base-table cleanup (or skip their table-only MVCC probe), and cover
repeated view binding with a cache-retention test.
--
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]