Skip to content

Commit

Permalink
Code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpwright committed Nov 22, 2024
1 parent 3ecc9b6 commit fa87da8
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ private List<String> 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);
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit fa87da8

Please sign in to comment.