[
https://issues.apache.org/jira/browse/DRILL-6313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pritesh Maker updated DRILL-6313:
---------------------------------
Fix Version/s: (was: 1.14.0)
> ScanBatch.Mutator does not report new schema for empty first batch
> ------------------------------------------------------------------
>
> Key: DRILL-6313
> URL: https://issues.apache.org/jira/browse/DRILL-6313
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.13.0
> Reporter: Paul Rogers
> Assignee: Paul Rogers
> Priority: Major
>
> Create a format plugin that honors an empty select list by returning no
> columns. This case occurs in a {{COUNT(\*)}} query.
> When run, the query fails with:
> {noformat}
> SYSTEM ERROR: IllegalStateException: next() returned OK without first
> returning OK_NEW_SCHEMA [#2, ScanBatch]
> {noformat}
> The reason is that the {{Mutator}} class uses a flag, {{schemaChanged}},
> which defaults to {{schemaChanged}}. It is set to {{true}} only when a field
> is added. But, since the query requested no fields, no field is added.
> The fix is simple, just default {{schemaChanged}} to {{true}}.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)