Fix reading required string values inside an optional group #481
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #480.
When string values are required and inside an optional nested group, the group is skipped over in
LogicalBatchReaderFactory
and we only use a singleLeafReader
instance to read values. This should read null into destination rows where the enclosing group is null. But when_nullableLeafValues
is false in theBufferedReader
, only the non-null values would be read so we'd reach the end of the values before reaching the expected number of rows/levels.We don't have the same problem for a required int inside an optional group for example as this is detected in
GetCompoundReader
whentypeof(TElement) != typeof(TLogical)
and is handled specially with theOptionalReader
class.