diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/PreserveColumnLayer.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/PreserveColumnLayer.java index d6bf93c9f13..57fc59f7fff 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/PreserveColumnLayer.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/PreserveColumnLayer.java @@ -24,13 +24,13 @@ */ final public class PreserveColumnLayer extends DependencyLayerBase { private final BitSet dependencyBitSet; - private final boolean flattenedResult; + private final boolean alreadyFlattenedSources; PreserveColumnLayer(SelectAndViewAnalyzer inner, String name, SelectColumn sc, ColumnSource cs, String[] deps, - ModifiedColumnSet mcsBuilder, boolean flattenedResult) { + ModifiedColumnSet mcsBuilder, boolean alreadyFlattenedSources) { super(inner, name, sc, cs, deps, mcsBuilder); this.dependencyBitSet = new BitSet(); - this.flattenedResult = flattenedResult; + this.alreadyFlattenedSources = alreadyFlattenedSources; Arrays.stream(deps).mapToInt(inner::getLayerIndexFor).forEach(dependencyBitSet::set); } @@ -77,15 +77,10 @@ public LogOutput append(LogOutput logOutput) { .append("}"); } - @Override - public boolean flattenedResult() { - return flattenedResult; - } - @Override public boolean alreadyFlattenedSources() { - // we can only preserve a flat source if it was already made flat - return flattenedResult; + // we can only preserve a flat source if it was already flat + return alreadyFlattenedSources; } @Override diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java index 20bc7928a49..de6d8bd4485 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/select/analyzers/SelectAndViewAnalyzer.java @@ -182,7 +182,7 @@ public static SelectAndViewAnalyzerWrapper create( } analyzer = analyzer.createLayerForPreserve( - sc.getName(), sc, sc.getDataView(), distinctDeps, mcsBuilder, flatResult && flattenedResult); + sc.getName(), sc, sc.getDataView(), distinctDeps, mcsBuilder, flattenedResult); if (!sourceIsNew) { // we can not flatten future columns because we are preserving a column that may not be flat @@ -196,7 +196,7 @@ public static SelectAndViewAnalyzerWrapper create( final ColumnSource alias = resultAlias.get(realColumn.getSourceName()); if (alias != null) { analyzer = analyzer.createLayerForPreserve( - sc.getName(), sc, alias, distinctDeps, mcsBuilder, flatResult); + sc.getName(), sc, alias, distinctDeps, mcsBuilder, flattenedResult); continue; } } @@ -387,8 +387,9 @@ private SelectAndViewAnalyzer createLayerForView(String name, SelectColumn sc, C } private SelectAndViewAnalyzer createLayerForPreserve(String name, SelectColumn sc, ColumnSource cs, - String[] parentColumnDependencies, ModifiedColumnSet mcsBuilder, boolean flatResult) { - return new PreserveColumnLayer(this, name, sc, cs, parentColumnDependencies, mcsBuilder, flatResult); + String[] parentColumnDependencies, ModifiedColumnSet mcsBuilder, boolean alreadyFlattenedSources) { + return new PreserveColumnLayer(this, name, sc, cs, parentColumnDependencies, mcsBuilder, + alreadyFlattenedSources); } abstract void populateModifiedColumnSetRecurse(ModifiedColumnSet mcsBuilder, Set remainingDepsToSatisfy);