suxiaogang223 commented on code in PR #59716:
URL: https://github.com/apache/doris/pull/59716#discussion_r2727373991
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataCache.java:
##########
@@ -160,58 +134,51 @@ private Table loadTable(IcebergMetadataCacheKey key) {
if (LOG.isDebugEnabled()) {
LOG.debug("load iceberg table {}", nameMapping, new
Exception());
}
- return ((ExternalCatalog)
catalog).getExecutionAuthenticator().execute(()
- -> ops.loadTable(nameMapping.getRemoteDbName(),
nameMapping.getRemoteTblName()));
+ Table table = ((ExternalCatalog)
catalog).getExecutionAuthenticator()
+ .execute(()
+ -> ops.loadTable(nameMapping.getRemoteDbName(),
nameMapping.getRemoteTblName()));
+ return new IcebergTableCacheValue(table);
} catch (Exception e) {
throw new RuntimeException(ExceptionUtils.getRootCauseMessage(e),
e);
}
}
@NotNull
- private IcebergSnapshotCacheValue loadSnapshot(IcebergMetadataCacheKey
key) throws AnalysisException {
- NameMapping nameMapping = key.nameMapping;
- TableIf dorisTable =
Env.getCurrentEnv().getCatalogMgr().getCatalogOrAnalysisException(nameMapping.getCtlId())
- .getDbOrAnalysisException(nameMapping.getLocalDbName())
- .getTableOrAnalysisException(nameMapping.getLocalTblName());
-
+ private IcebergSnapshotCacheValue loadSnapshot(ExternalTable dorisTable) {
if (!(dorisTable instanceof MTMVRelatedTableIf)) {
- throw new AnalysisException(String.format("Table %s.%s is not a
valid MTMV related table.",
- nameMapping.getLocalDbName(),
nameMapping.getLocalTblName()));
+ throw new RuntimeException(String.format("Table %s.%s is not a
valid MTMV related table.",
+ dorisTable.getDbName(), dorisTable.getName()));
}
- MTMVRelatedTableIf table = (MTMVRelatedTableIf) dorisTable;
- IcebergSnapshot lastedIcebergSnapshot =
IcebergUtils.getLastedIcebergSnapshot((ExternalTable) table);
- IcebergPartitionInfo icebergPartitionInfo;
- if (!table.isValidRelatedTable()) {
- icebergPartitionInfo = IcebergPartitionInfo.empty();
- } else {
- icebergPartitionInfo =
IcebergUtils.loadPartitionInfo((ExternalTable) table,
- lastedIcebergSnapshot.getSnapshotId());
+ try {
+ MTMVRelatedTableIf table = (MTMVRelatedTableIf) dorisTable;
+ IcebergSnapshot lastedIcebergSnapshot =
IcebergUtils.getLastedIcebergSnapshot(dorisTable);
Review Comment:
I will fix this
--
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]