add getQueryState() to recordBatch, so we can query the state of the cur...

...rent record batch for error handling