[
https://issues.apache.org/jira/browse/DRILL-2288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14933588#comment-14933588
]
Daniel Barclay (Drill) commented on DRILL-2288:
-----------------------------------------------
Found probable cause of ScanBatch.next()'s returning NONE instead of
OK_NEW_SCHEMA:
For some JSON files (probably those containing maps), the JSON reader reports a
spurious schema change at the end of each such JSON file.
That in turn happened because the method to check and reset the schema-changed
status of nested items was called in the right-hand side of a OR operator
(||)--so when the left-hand-side condition (the schema-changed status at the
top level) was already true, the nested status wasn't cleared as it should have
been.
> ResultSetMetaData not set for zero-row result
> (DatabaseMetaData.getColumns(...)) [ScanBatch problem]
> -----------------------------------------------------------------------------------------------------
>
> Key: DRILL-2288
> URL: https://issues.apache.org/jira/browse/DRILL-2288
> Project: Apache Drill
> Issue Type: Bug
> Components: Storage - Information Schema
> Reporter: Daniel Barclay (Drill)
> Assignee: Daniel Barclay (Drill)
> Fix For: 1.2.0
>
> Attachments: Drill2288NoResultSetMetadataWhenZeroRowsTest.java
>
>
> The ResultSetMetaData object from getMetadata() of a ResultSet is not set up
> (getColumnCount() returns zero, and trying to access any other metadata
> throws IndexOutOfBoundsException) for a result set with zero rows, at least
> for one from DatabaseMetaData.getColumns(...).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)