[
https://issues.apache.org/jira/browse/DRILL-4006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14987644#comment-14987644
]
ASF GitHub Bot commented on DRILL-4006:
---------------------------------------
Github user jacques-n commented on a diff in the pull request:
https://github.com/apache/drill/pull/233#discussion_r43777175
--- Diff: exec/java-exec/src/main/codegen/templates/MapWriters.java ---
@@ -110,9 +110,9 @@ public ListWriter list(String name) {
FieldWriter writer = fields.get(name.toLowerCase());
if(writer == null) {
writer = new SingleListWriter(name, container, this);
- writer.setPosition(${index});
fields.put(name.toLowerCase(), writer);
}
+ writer.setPosition(${index});
--- End diff --
Your change seems to violate the design pattern of the writers. Position is
managed via the setPosition call at line 152. If you're seeing problems, you
should figure who isn't calling that method. I believe the code before your
change is correct: the only reason we should have to reposition a writer when
we retrieve it is it didn't previously exist and we had to create a new one.
This is the pattern used across the board for position in the context of all
the writers. Position is managed externally and only a new field creation
should cause a location position set.
> 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)