Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Use PredicateSearchKey instead of PaimonFilter to avoid cache coherency problem #55787

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.starrocks.connector.GetRemoteFilesParams;
import com.starrocks.connector.HdfsEnvironment;
import com.starrocks.connector.PartitionInfo;
import com.starrocks.connector.PredicateSearchKey;
import com.starrocks.connector.RemoteFileDesc;
import com.starrocks.connector.RemoteFileInfo;
import com.starrocks.connector.TableVersionRange;
Expand Down Expand Up @@ -78,7 +79,7 @@ public class PaimonMetadata implements ConnectorMetadata {
private final String catalogName;
private final Map<Identifier, Table> tables = new ConcurrentHashMap<>();
private final Map<String, Database> databases = new ConcurrentHashMap<>();
private final Map<PaimonFilter, PaimonSplitsInfo> paimonSplits = new ConcurrentHashMap<>();
private final Map<PredicateSearchKey, PaimonSplitsInfo> paimonSplits = new ConcurrentHashMap<>();
private final Map<String, Long> partitionInfos = new ConcurrentHashMap<>();
private final ConnectorProperties properties;

Expand Down Expand Up @@ -249,9 +250,12 @@ public boolean tableExists(String dbName, String tableName) {
public List<RemoteFileInfo> getRemoteFiles(Table table, GetRemoteFilesParams params) {
RemoteFileInfo remoteFileInfo = new RemoteFileInfo();
PaimonTable paimonTable = (PaimonTable) table;
PaimonFilter filter =
new PaimonFilter(paimonTable.getCatalogDBName(), paimonTable.getCatalogTableName(), params.getPredicate(),
params.getFieldNames());
long latestSnapshotId = -1L;
if (paimonTable.getNativeTable().latestSnapshotId().isPresent()) {
latestSnapshotId = paimonTable.getNativeTable().latestSnapshotId().getAsLong();
}
PredicateSearchKey filter = PredicateSearchKey.of(paimonTable.getCatalogDBName(),
paimonTable.getCatalogTableName(), latestSnapshotId, params.getPredicate());
if (!paimonSplits.containsKey(filter)) {
ReadBuilder readBuilder = paimonTable.getNativeTable().newReadBuilder();
int[] projected =
Expand Down
Loading