Skip to content

Commit

Permalink
Minor changes based on PR review.
Browse files Browse the repository at this point in the history
Signed-off-by: forestmvey <forestv@bitquilltech.com>
  • Loading branch information
forestmvey committed Mar 30, 2023
1 parent dc718e2 commit 9b803d4
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ public class UnnestOperator extends PhysicalPlan {
private final Set<String> fields; // Needs to be a Set to match legacy implementation
@Getter
private final Map<String, List<String>> groupedPathsAndFields;
List<Map<String, ExprValue>> result = new ArrayList<>();
List<String> nonNestedFields = new ArrayList<>();
@EqualsAndHashCode.Exclude
private List<Map<String, ExprValue>> result = new ArrayList<>();
@EqualsAndHashCode.Exclude
private List<String> nonNestedFields = new ArrayList<>();
@EqualsAndHashCode.Exclude
private ListIterator<Map<String, ExprValue>> flattenedResult = result.listIterator();

Expand Down Expand Up @@ -100,10 +102,12 @@ public ExprValue next() {

ExprValue inputValue = input.next();
generateNonNestedFieldsMap(inputValue);
// Add all nested fields to result map
for (String field : fields) {
result = flatten(field, inputValue, result, true);
}

// Add all non-nested fields to result map
for (String nonNestedField : nonNestedFields) {
result = flatten(nonNestedField, inputValue, result, false);
}
Expand Down

0 comments on commit 9b803d4

Please sign in to comment.