KazydubB commented on a change in pull request #1870: DRILL-7359: Add support for DICT type in RowSet Framework URL: https://github.com/apache/drill/pull/1870#discussion_r348472429
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/physical/resultSet/model/single/BaseReaderBuilder.java ########## @@ -77,22 +81,48 @@ protected AbstractObjectReader buildVectorReader(ValueVector vector, VectorDescr final MajorType type = va.type(); switch(type.getMinorType()) { - case MAP: - return buildMap((AbstractMapVector) vector, va, type.getMode(), descrip); - case UNION: - return buildUnion((UnionVector) vector, va, descrip); - case LIST: - return buildList(vector, va, descrip); - case LATE: - - // Occurs for a list with no type: a list of nulls. - - return AbstractScalarReader.nullReader(descrip.metadata); - default: - return buildScalarReader(va, descrip.metadata); + case DICT: + return buildDict(vector, va, descrip); + case MAP: + return buildMap((AbstractMapVector) vector, va, type.getMode(), descrip); + case UNION: + return buildUnion((UnionVector) vector, va, descrip); + case LIST: + return buildList(vector, va, descrip); + case LATE: + + // Occurs for a list with no type: a list of nulls. + + return AbstractScalarReader.nullReader(descrip.metadata); + default: + return buildScalarReader(va, descrip.metadata); } } + private AbstractObjectReader buildDict(ValueVector vector, VectorAccessor va, VectorDescrip descrip) { + + boolean isArray = descrip.metadata.isArray(); + + DictVector dictVector; + VectorAccessor dictAccessor; + if (isArray) { Review comment: To clarify, this builds reader for `REPEATED DICT` and `DICT`. Its fields (`key` and `value`) are handled in `buildMapMembers(AbstractMapVector, MetadataProvider)` which was written for handling fields for `MAP` and `REPEATED MAP` and now for both cases of `DICT`. (Yeah, the method probably should've been renamed taking into account its usage for `DICT`). Is the above which concerns you or have I unterstood you incorrectly? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services