[fix](paimon)fix paimon cache bug (#35309)

Issue Number: close #35024 
This bug is because the fe incorrectly sets the update time of paimon
catalog, causing the be to be unable to update paimon's schema in time.
```c++
    private void initTable() {
        PaimonTableCacheKey key = new PaimonTableCacheKey(ctlId, dbId, tblId, paimonOptionParams, dbName, tblName);
        TableExt tableExt = PaimonTableCache.getTable(key);
        if (tableExt.getCreateTime() < lastUpdateTime) {
            LOG.warn("invalidate cache table:{}, localTime:{}, remoteTime:{}", key, tableExt.getCreateTime(),
                    lastUpdateTime);
            PaimonTableCache.invalidateTableCache(key);
            tableExt = PaimonTableCache.getTable(key);
        }
        this.table = tableExt.getTable();
        paimonAllFieldNames = PaimonScannerUtils.fieldNames(this.table.rowType());
        if (LOG.isDebugEnabled()) {
            LOG.debug("paimonAllFieldNames:{}", paimonAllFieldNames);
        }
    }
```
This commit is contained in:
苏小刚
2024-05-28 16:47:51 +08:00
committed by yiguolei
parent 2e1318b8a0
commit 72a27a0938
3 changed files with 9 additions and 6 deletions

View File

@ -539,10 +539,6 @@ public interface TableIf {
return getType() == TableType.OLAP || getType() == TableType.MATERIALIZED_VIEW;
}
default long getLastUpdateTime() {
return -1L;
}
default long getDataSize(boolean singleReplica) {
// TODO: Each tableIf should impl it by itself.
return 0;

View File

@ -169,7 +169,7 @@ public class PaimonScanNode extends FileQueryScanNode {
fileDesc.setCtlId(source.getCatalog().getId());
fileDesc.setDbId(((PaimonExternalTable) source.getTargetTable()).getDbId());
fileDesc.setTblId(source.getTargetTable().getId());
fileDesc.setLastUpdateTime(source.getTargetTable().getLastUpdateTime());
fileDesc.setLastUpdateTime(source.getTargetTable().getUpdateTime());
Optional<DeletionFile> optDeletionFile = paimonSplit.getDeletionFile();
if (optDeletionFile.isPresent()) {
DeletionFile deletionFile = optDeletionFile.get();