Skip to content

ORC-753: [C++] Clear stream state of ColumnReader after seek#645

Merged
xndai merged 1 commit intoapache:masterfrom
wgtmac:ORC-753
Feb 27, 2021
Merged

ORC-753: [C++] Clear stream state of ColumnReader after seek#645
xndai merged 1 commit intoapache:masterfrom
wgtmac:ORC-753

Conversation

@wgtmac
Copy link
Member

@wgtmac wgtmac commented Feb 20, 2021

What changes were proposed in this pull request?

C++ ORC ColumnReaders of some types have cached buffer state to issue next I/O. This is fine if we read streams continuously. However, if we try to skip some row groups and seek to a random row group, the cached buffer state is wrong and may lead to undefined behavior. This patch fixes it by clearing all stream states in the ColumnReader.

Why are the changes needed?

This fix is a prerequisite to introduce PPD to C++ ORC reader in that the read pattern requires seeking to any row group.

How was this patch tested?

This is a trivial fix and just make sure it doesn't break any unit test case.

@wgtmac
Copy link
Member Author

wgtmac commented Feb 20, 2021

@dongjoon-hyun I have split this minor fix from the PPD patch. Please review it when you have time. Thanks!

Copy link
Contributor

@xndai xndai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xndai xndai merged commit 3937521 into apache:master Feb 27, 2021
@dongjoon-hyun
Copy link
Member

+1, late LGTM. Thank you, @wgtmac .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants