Skip to content

Commit

Permalink
transformation version
Browse files Browse the repository at this point in the history
  • Loading branch information
cpwright committed Mar 7, 2025
1 parent ee07271 commit 22a74c0
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static TableUpdateValidator make(final String description, final QueryTab

private TrackingWritableRowSet rowSet;
private QueryTable resultTable;
private ModifiedColumnSet.Transformer mcsTransformer;
private SharedContext sharedContext;
private final String description;

Expand Down Expand Up @@ -108,7 +109,9 @@ public Result<QueryTable> initialize(boolean usePrev, long beforeClock) {

resultTable = new QueryTable(tableToValidate.getDefinition(), rowSet,
new LinkedHashMap<>(tableToValidate.getColumnSourceMap()),
tableToValidate.getModifiedColumnSetForUpdates(), tableToValidate.getAttributes());
null,
tableToValidate.getAttributes());
mcsTransformer = tableToValidate .newModifiedColumnSetIdentityTransformer(resultTable);

final TableUpdateListener listener;
try (final SafeCloseable ignored1 = maybeOpenSharedContext();
Expand Down Expand Up @@ -222,7 +225,11 @@ private void onUpdate(final TableUpdate upstream) {
return;
}

resultTable.notifyListeners(upstream.acquire());
final TableUpdateImpl downstream = TableUpdateImpl.copy(upstream);
downstream.modifiedColumnSet = resultTable.getModifiedColumnSetForUpdates();
mcsTransformer.clearAndTransform(upstream.modifiedColumnSet(), downstream.modifiedColumnSet);

resultTable.notifyListeners(downstream);
}
}

Expand Down

0 comments on commit 22a74c0

Please sign in to comment.