Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.paimon.predicate.Predicate;
import org.apache.paimon.table.BucketMode;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.Table;
import org.apache.paimon.table.source.OutOfRangeException;
import org.apache.paimon.utils.FileIOUtils;
import org.apache.paimon.utils.Filter;
Expand Down Expand Up @@ -79,7 +78,7 @@ public class FileStoreLookupFunction implements Serializable, Closeable {

private static final Logger LOG = LoggerFactory.getLogger(FileStoreLookupFunction.class);

private final Table table;
private final FileStoreTable table;
@Nullable private final PartitionLoader partitionLoader;
private final List<String> projectFields;
private final List<String> joinKeys;
Expand Down Expand Up @@ -176,26 +175,19 @@ private void open() throws Exception {
projectFields,
joinKeys);

FileStoreTable storeTable = (FileStoreTable) table;

LOG.info("Creating lookup table for {}.", table.name());
if (options.get(LOOKUP_CACHE_MODE) == LookupCacheMode.AUTO
&& new HashSet<>(table.primaryKeys()).equals(new HashSet<>(joinKeys))) {
if (isRemoteServiceAvailable(storeTable)) {
if (isRemoteServiceAvailable(table)) {
this.lookupTable =
PrimaryKeyPartialLookupTable.createRemoteTable(
storeTable, projection, joinKeys);
PrimaryKeyPartialLookupTable.createRemoteTable(table, projection, joinKeys);
LOG.info(
"Remote service is available. Created PrimaryKeyPartialLookupTable with remote service.");
} else {
try {
this.lookupTable =
PrimaryKeyPartialLookupTable.createLocalTable(
storeTable,
projection,
path,
joinKeys,
getRequireCachedBucketIds());
table, projection, path, joinKeys, getRequireCachedBucketIds());
LOG.info(
"Remote service isn't available. Created PrimaryKeyPartialLookupTable with LocalQueryExecutor.");
} catch (UnsupportedOperationException ignore) {
Expand All @@ -210,7 +202,7 @@ private void open() throws Exception {
if (lookupTable == null) {
FullCacheLookupTable.Context context =
new FullCacheLookupTable.Context(
storeTable,
table,
projection,
predicate,
createProjectedPredicate(projection),
Expand Down