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

Test for null result in DataIndexer.getOptimalPartialIndex #5449

Merged
merged 1 commit into from
May 2, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static DataIndex getOptimalPartialIndex(Table table, final String... keyC
.filter(Objects::nonNull)
.max(Comparator.comparingLong(dataIndex -> dataIndex.table().size()))
.orElse(null),
table::isRefreshing, DataIndex::isRefreshing);
table::isRefreshing, (final DataIndex result) -> result != null && result.isRefreshing());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@ private void testWhereInDependencyInternal(
}
}

@Test
public void testWhereInOptimalIndexSelectionWithNoneAvailable() {
final Table lhs = emptyTable(10).update("Part=ii % 2 == 0 ? `Apple` : `Pie`", "Hello=ii", "Goodbye = `A`+ii");
DataIndexer.getOrCreateDataIndex(lhs, "Part");
final Table rhs = emptyTable(2).update("Hello=ii", "Goodbye = `A`+ii");
final Table result = lhs.whereIn(rhs, "Goodbye");
assertTableEquals(lhs.head(2), result);
}

@Test
public void testWhereDynamicIn() {
final QueryTable setTable = testRefreshingTable(i(2, 4, 6, 8).toTracking(), col("X", "A", "B", "C", "B"));
Expand Down
Loading