Skip to content

Commit

Permalink
Spotless + Charles' Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Nov 6, 2023
1 parent ac393d1 commit e48fd72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public LogOutput append(LogOutput logOutput) {

@Override
public boolean flattenedResult() {
// a preserve layer is only flattened if the inner is flattened
// the "flattenedResult" means that we are flattening the table as part of select. For a pre-existing column, we
// could not preserve a layer while flattening, but if we are preserving a newly generated column; it is valid for
// the result to have been flattened as part of select.
// preserve layer is only flattened if the inner is flattened
// the "flattenedResult" means that we are flattening the table as part of select. For a pre-existing column, we
// could not preserve a layer while flattening, but if we are preserving a newly generated column; it is valid
// for the result to have been flattened as part of select.
return inner.flattenedResult();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,22 @@ public static SelectAndViewAnalyzerWrapper create(

if (realColumn != null && shouldPreserve(sc)) {
boolean sourceIsNew = resultColumns.contains(realColumn.getSourceName());
if (!sourceIsNew && numberOfInternallyFlattenedColumns > 0) {
// we must preserve this column, but have already created an analyzer for the internally flattened
// column, therefore must start over without permitting internal flattening
return create(sourceTable, mode, columnSources, originalRowSet, parentMcs, publishTheseSources,
useShiftedColumns, false, selectColumns);
if (!sourceIsNew) {
if (numberOfInternallyFlattenedColumns > 0) {
// we must preserve this column, but have already created an analyzer for the internally
// flattened
// column, therefore must start over without permitting internal flattening
return create(sourceTable, mode, columnSources, originalRowSet, parentMcs, publishTheseSources,
useShiftedColumns, false, selectColumns);
} else {
// we can not flatten future columns because we are preserving a column that may not be flat
flattenedResult = false;
}
}

analyzer = analyzer.createLayerForPreserve(
sc.getName(), sc, sc.getDataView(), distinctDeps, mcsBuilder);

if (!sourceIsNew) {
// we can not flatten future columns because we are preserving a column that may not be flat
flattenedResult = false;
}
continue;
}

Expand Down

0 comments on commit e48fd72

Please sign in to comment.