vvysotskyi commented on a change in pull request #1829: DRILL-7096: Develop
vector for canonical Map<K,V>
URL: https://github.com/apache/drill/pull/1829#discussion_r317140836
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
##########
@@ -523,14 +516,43 @@ private HoldingContainer
visitValueVectorReadExpression(ValueVectorReadExpressio
eval.add(expr.invoke("setPosition").arg(recordIndex));
int listNum = 0;
+ JVar valueIndex = eval.decl(generator.getModel().INT, "valueIndex",
JExpr.lit(-1));
+
+ int depth = 0;
+ boolean isMap = e.getFieldId().isMap(depth);
+
while (seg != null) {
if (seg.isArray()) {
+
// stop once we get to the last segment and the final type is
neither complex nor repeated (map, list, repeated list).
// In case of non-complex and non-repeated type, we return Holder,
in stead of FieldReader.
if (seg.isLastPath() && !complex && !repeated && !listVector) {
break;
}
+ depth++;
+
+ if (isMap) {
+ JExpression keyExpr =
JExpr.lit(seg.getArraySegment().getIndex());
+
+ JVar dictReader = generator.declareClassField("dictReader",
generator.getModel()._ref(BaseReader.DictReader.class));
Review comment:
Could you please also use FieldReader here to be consistent with the code in
this method?
----------------------------------------------------------------
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]
With regards,
Apache Git Services