Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/1125#discussion_r169859674 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchSizer.java --- @@ -245,16 +251,30 @@ private void buildVectorInitializer(VectorInitializer initializer) { else if (width > 0) { initializer.variableWidth(name, width); } + + for (ColumnSize columnSize : childColumnSizes.values()) { + columnSize.buildVectorInitializer(initializer); + } } + } public static ColumnSize getColumn(ValueVector v, String prefix) { return new ColumnSize(v, prefix); } + public ColumnSize getColumn(String name) { + return allColumnSizes.get(name); + } + public static final int MAX_VECTOR_SIZE = ValueVector.MAX_BUFFER_SIZE; // 16 MiB - private Map<String, ColumnSize> columnSizes = CaseInsensitiveMap.newHashMap(); + // This keeps information for all columns i.e. all top columns and nested columns underneath + private Map<String, ColumnSize> allColumnSizes = CaseInsensitiveMap.newHashMap(); --- End diff -- I'm a bit confused. I saw above that a `ColumnSize` has a list of children. Why are the children repeated here, introducing the naming issues described below? Given the column alias issues, and how column index is used elsewhere, can this just be an index of top-level columns? Then, to size map vectors (the only one that has the nesting issue), use the code for recursion that already exists in the `VectorInitializer`?
---