[
https://issues.apache.org/jira/browse/DRILL-7359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16975880#comment-16975880
]
ASF GitHub Bot commented on DRILL-7359:
---------------------------------------
paul-rogers commented on pull request #1870: DRILL-7359: Add support for DICT
type in RowSet Framework
URL: https://github.com/apache/drill/pull/1870#discussion_r347114932
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/resultSet/model/single/BaseWriterBuilder.java
##########
@@ -75,19 +78,32 @@ protected BaseWriterBuilder(ColumnConversionFactory
conversionFactory) {
private AbstractObjectWriter buildVectorWriter(ValueVector vector,
VectorDescrip descrip) {
final MajorType type = vector.getField().getType();
switch (type.getMinorType()) {
- case MAP:
- return MapWriter.buildMapWriter(descrip.metadata,
- (AbstractMapVector) vector,
- buildMap((AbstractMapVector) vector, descrip));
+ case DICT:
+ return buildDict(vector, descrip);
+ case MAP:
+ return MapWriter.buildMapWriter(descrip.metadata,
+ (AbstractMapVector) vector,
+ buildMap((AbstractMapVector) vector, descrip));
- case UNION:
- return buildUnion((UnionVector) vector, descrip);
+ case UNION:
+ return buildUnion((UnionVector) vector, descrip);
- case LIST:
- return buildList(vector, descrip);
+ case LIST:
+ return buildList(vector, descrip);
- default:
- return ColumnWriterFactory.buildColumnWriter(descrip.metadata,
conversionFactory, vector);
+ default:
+ return ColumnWriterFactory.buildColumnWriter(descrip.metadata,
conversionFactory, vector);
+ }
+ }
+
+ private AbstractObjectWriter buildDict(ValueVector vector, VectorDescrip
descrip) {
+ if (vector.getField().getType().getMode() == DataMode.REPEATED) {
Review comment:
Again, it *should* be possible to simply call `buildVectorWriter` and handle
the key and value vectors recursively so you don't have to repeat the type
checks in this method.
If the recursive construction does not work, it is likely because of some
details that we can figure out. (As noted above, this code is tricky because of
multiple constraints imposed by the `MaterializedField`, `VaueVector` and
writer classes.)
----------------------------------------------------------------
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:
[email protected]
> Add support for DICT type in RowSet Framework
> ---------------------------------------------
>
> Key: DRILL-7359
> URL: https://issues.apache.org/jira/browse/DRILL-7359
> Project: Apache Drill
> Issue Type: New Feature
> Reporter: Bohdan Kazydub
> Assignee: Bohdan Kazydub
> Priority: Major
> Fix For: 1.17.0
>
>
> Add support for new DICT data type (see DRILL-7096) in RowSet Framework
--
This message was sent by Atlassian Jira
(v8.3.4#803005)