[
https://issues.apache.org/jira/browse/DRILL-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13804373#comment-13804373
]
Jacques Nadeau commented on DRILL-254:
--------------------------------------
The approach i'm taking is creating a new IteratorValidator operator that is
inserted between all other operators at Implementation time if assertions are
enabled. The semantics are as follows:
For the RecordBatch interface
A IllegalStateException is thrown if any of these methods are called and we've
most recently returned either an OK or OK_NEW_SCHEMA.
public Iterator<VectorWrapper<?>> iterator()
public BatchSchema getSchema()
public int getRecordCount()
public SelectionVector2 getSelectionVector2()
public SelectionVector4 getSelectionVector4()
public TypedFieldId getValueVectorId(SchemaPath path)
public VectorWrapper<?> getValueAccessorById(int fieldId, Class<?> clazz)
public WritableBatch getWritableBatch()
Additionally, if you attempt to call the next() method, we throw an
IllegalStateException if the previous state was NONE.
Once completed, this should reveal where we are violating interface contracts
and correct those bugs.
> When an IterOutcome is NONE, do not access the batch
> ----------------------------------------------------
>
> Key: DRILL-254
> URL: https://issues.apache.org/jira/browse/DRILL-254
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Ben Becker
> Assignee: Jacques Nadeau
>
> Data associated with a RecordBatch/RootExec in the NONE state should not be
> relied upon.
> This requires changes to logic in various parts of the code base; if an
> operator returns a NONE state, do not attempt to access the batch (e.g.
> record count, field metadata, value vectors, etc.).
--
This message was sent by Atlassian JIRA
(v6.1#6144)