Copilot commented on code in PR #52498:
URL: https://github.com/apache/doris/pull/52498#discussion_r2177626327


##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/MetadataGenerator.java:
##########
@@ -948,10 +949,10 @@ private static TFetchSchemaTableDataResult 
dealHMSCatalog(HMSExternalCatalog cat
         return result;
     }
 
-    private static TFetchSchemaTableDataResult 
dealMaxComputeCatalog(MaxComputeExternalCatalog catalog, String dbName,
-            String tableName) {
+    private static TFetchSchemaTableDataResult 
dealMaxComputeCatalog(MaxComputeExternalCatalog catalog,
+            ExternalTable table) {
         List<TRow> dataBatch = Lists.newArrayList();
-        List<String> partitionNames = catalog.listPartitionNames(dbName, 
tableName);
+        List<String> partitionNames = 
catalog.listPartitionNames(table.getRemoteDbName(), table.getRemoteDbName());

Review Comment:
   The second argument to listPartitionNames should be the table name, not the 
database name. Replace the second `getRemoteDbName()` with `getRemoteName()`. 
For example: `catalog.listPartitionNames(table.getRemoteDbName(), 
table.getRemoteName())`.
   ```suggestion
           List<String> partitionNames = 
catalog.listPartitionNames(table.getRemoteDbName(), table.getRemoteName());
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonMetadataCache.java:
##########
@@ -100,26 +127,27 @@ private PaimonSnapshot 
loadLatestSnapshot(PaimonSnapshotCacheKey key) throws IOE
 
     public void invalidateCatalogCache(long catalogId) {
         snapshotCache.asMap().keySet().stream()
-                .filter(key -> key.getCatalog().getId() == catalogId)
+                .filter(key -> key.getNameMapping().getCtlId() == catalogId)
                 .forEach(snapshotCache::invalidate);
     }
 
-    public void invalidateTableCache(long catalogId, String dbName, String 
tblName) {
+    public void invalidateTableCache(ExternalTable dorisTable) {
         snapshotCache.asMap().keySet().stream()
-                .filter(key -> key.getCatalog().getId() == catalogId && 
key.getDbName().equals(dbName)
-                        && key.getTableName().equals(
-                        tblName))
+                .filter(key -> key.getNameMapping().getCtlId() == 
dorisTable.getCatalog().getId()
+                        && 
key.getNameMapping().getLocalTblName().equals(dorisTable.getDbName())

Review Comment:
   This comparison is using `getLocalTblName()` for both database and table 
name checks. The first comparison should use `getLocalDbName()` to match the 
DB: `key.getNameMapping().getLocalDbName().equals(dorisTable.getDbName())`.
   ```suggestion
                           && 
key.getNameMapping().getLocalDbName().equals(dorisTable.getDbName())
   ```



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

Reply via email to