From fa87da883fbda4257bc2fb0cc480fee488f85929 Mon Sep 17 00:00:00 2001 From: "Charles P. Wright" Date: Fri, 22 Nov 2024 16:08:35 -0500 Subject: [PATCH] Code review. --- .../table/impl/select/FilterSelectColumn.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FilterSelectColumn.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FilterSelectColumn.java index 0b9b358265a..74926639988 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FilterSelectColumn.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/FilterSelectColumn.java @@ -114,14 +114,14 @@ private List checkForInvalidFilters() { + filter); } if (filter.isRefreshing()) { - // TODO: DH-18052: updateView and view should support refreshing Filter Expressions - // - // This would enable us to use a whereIn or whereNotIn for things like conditional formatting; which could - // be attractive. However, a join or actualy wouldMatch gets you there without the additional complexity. - // - // Supporting this requires SelectColumn dependencies, which have not previously existed. Additionally, - // if we were to support these for select and update (as opposed to view and updateView), then the filter - // could require recomputing the entire result table whenever anything changes. + /* TODO: DH-18052: updateView and view should support refreshing Filter Expressions + * + * This would enable us to use a whereIn or whereNotIn for things like conditional formatting; which could + * be attractive. However, a join or wouldMatch gets you there without the additional complexity. + * + * Supporting this requires SelectColumn dependencies, which have not previously existed. Additionally, + * if we were to support these for select and update (as opposed to view and updateView), then the filter + * could require recomputing the entire result table whenever anything changes. */ throw new UncheckedTableException( "Cannot use a refreshing filter in select, view, update, or updateView: " + filter); } @@ -215,15 +215,17 @@ public FilterFormula() { @Override public Boolean getBoolean(final long rowKey) { - try (final WritableRowSet filteredRowSet = - filter.filter(RowSetFactory.fromKeys(rowKey), tableToFilter.getRowSet(), tableToFilter, false)) { + try (final WritableRowSet selection = RowSetFactory.fromKeys(rowKey); + final WritableRowSet filteredRowSet = + filter.filter(selection, tableToFilter.getRowSet(), tableToFilter, false)) { return filteredRowSet.isNonempty(); } } @Override public Boolean getPrevBoolean(final long rowKey) { - try (final WritableRowSet filteredRowSet = filter.filter(RowSetFactory.fromKeys(rowKey), + try (final WritableRowSet selection = RowSetFactory.fromKeys(rowKey); + final WritableRowSet filteredRowSet = filter.filter(selection, tableToFilter.getRowSet().prev(), tableToFilter, true)) { return filteredRowSet.isNonempty(); }