Skip to content

Commit

Permalink
Fix bug that allows re-use of memoized coalesced result that is no lo…
Browse files Browse the repository at this point in the history
…nger live
  • Loading branch information
rcaudy committed May 17, 2024
1 parent 84f71a7 commit 444ee26
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.deephaven.api.filter.Filter;
import io.deephaven.base.verify.Assert;
import io.deephaven.datastructures.util.CollectionUtil;
import io.deephaven.engine.liveness.Liveness;
import io.deephaven.engine.table.*;
import io.deephaven.engine.table.impl.select.analyzers.SelectAndViewAnalyzer;
import io.deephaven.engine.table.impl.select.MatchFilter;
Expand Down Expand Up @@ -89,7 +90,7 @@ public Table where(Filter filter) {
private Table getResultTableWithWhere(WhereFilter... whereFilters) {
{
final Table coalesced = getCoalesced();
if (coalesced != null) {
if (Liveness.verifyCachedObjectForReuse(coalesced)) {
return coalesced.where(Filter.and(whereFilters));
}
}
Expand Down Expand Up @@ -259,7 +260,7 @@ public Table selectDistinct(Collection<? extends Selectable> columns) {
/* If the cachedResult table has already been created, we can just use that. */
{
final Table coalesced = getCoalesced();
if (coalesced != null) {
if (Liveness.verifyCachedObjectForReuse(coalesced)) {
return coalesced.selectDistinct(columns);
}
}
Expand Down

0 comments on commit 444ee26

Please sign in to comment.