[
https://issues.apache.org/jira/browse/DRILL-4006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14990905#comment-14990905
]
ASF GitHub Bot commented on DRILL-4006:
---------------------------------------
Github user StevenMPhillips commented on the pull request:
https://github.com/apache/drill/pull/242#issuecomment-153924675
I think the fix is in the wrong place. We should fix the underlying vector.
I was able to fix the problem with a small change to
BaseRepeatedValueVector.BaseRepeatedMutator:
```java
@Override
public void startNewValue(int index) {
while (offsets.getValueCapacity() <= index) {
offsets.reAlloc();
}
offsets.getMutator().setSafe(index+1,
offsets.getAccessor().get(index));
setValueCount(index+1);
}
```
We shouldn't need to make any change in the writer.
> As json reader reads a field with empty lists, IOOB could happen
> ----------------------------------------------------------------
>
> Key: DRILL-4006
> URL: https://issues.apache.org/jira/browse/DRILL-4006
> Project: Apache Drill
> Issue Type: Bug
> Components: Storage - JSON
> Reporter: Sean Hsuan-Yi Chu
> Assignee: Sean Hsuan-Yi Chu
> Attachments: a.json, b.json, c.json
>
>
> If a field in a json file has many empty lists before a non-empty list, there
> could be an IOOB exception.
> Running the following query on the folder with files in the attachment can
> reproduce the observation:
> {code}
> select a from`folder`
> {code}
> Exception:
> org.apache.drill.common.exceptions.UserRemoteException: DATA_READ ERROR:
> index: 4448, length: 4
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)