paul-rogers commented on a change in pull request #1623: DRILL-7006: Add type
conversion to row writers
URL: https://github.com/apache/drill/pull/1623#discussion_r251662211
##########
File path:
exec/vector/src/main/java/org/apache/drill/exec/vector/accessor/writer/ScalarArrayWriter.java
##########
@@ -60,13 +60,17 @@
public final void nextElement() { next(); }
}
- private final BaseScalarWriter elementWriter;
+ private final ConcreteWriter elementWriter;
public ScalarArrayWriter(ColumnMetadata schema,
RepeatedValueVector vector, BaseScalarWriter elementWriter) {
super(schema, vector.getOffsetVector(),
new ScalarObjectWriter(elementWriter));
- this.elementWriter = elementWriter;
+
+ // Save the writer from the scalar object writer created above
+ // which may have wrapped the element writer in a type convertor.
+
+ this.elementWriter = (ConcreteWriter) elementObjWriter.scalar();
Review comment:
Yes. The plumbing ensures that the actual implementation is always of this
class. This is, however, part of the messiness described in a comment
elsewhere. I'm think about how to refactor this to avoid the need for these
casts, for the clunky pass-through methods in the type converter, and to make
the change fit into the result set loader. This is a first step.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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