paul-rogers commented on a change in pull request #1868: DRILL-7377: Nested
schemas for dynamic EVF columns
URL: https://github.com/apache/drill/pull/1868#discussion_r332301132
##########
File path:
exec/vector/src/main/java/org/apache/drill/exec/vector/accessor/writer/AbstractTupleWriter.java
##########
@@ -205,20 +208,29 @@ public int addColumnWriter(AbstractObjectWriter
colWriter) {
@Override
public int addColumn(ColumnMetadata column) {
- if (listener == null) {
- throw new UnsupportedOperationException("addColumn");
- }
+ verifyAddColumn(column.name());
final AbstractObjectWriter colWriter = (AbstractObjectWriter)
listener.addColumn(this, column);
return addColumnWriter(colWriter);
}
@Override
public int addColumn(MaterializedField field) {
+ verifyAddColumn(field.getName());
+ final AbstractObjectWriter colWriter = (AbstractObjectWriter)
listener.addColumn(this, field);
Review comment:
Agreed this is awkward; but it is less awkward than the alternative. The
idea is that the interfaces provide a clean interface for clients. I tried
making the change, but then the implementation class, `AbstractObjectWriter`
starts leaking through in many places. For example, the `getColumn()` method in
the `TupleWriter` must return `AbstractObjectWriter`.
So, my thought was that the least intrusive solution is to simply cast to
the implementation type the few places that it is needed rather than expose the
implementation classes to clients.
----------------------------------------------------------------
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