wgtmac commented on code in PR #37127:
URL: https://github.com/apache/arrow/pull/37127#discussion_r1293615261
##########
cpp/src/parquet/encoding.cc:
##########
@@ -1171,11 +1171,9 @@ int PlainBooleanDecoder::Decode(uint8_t* buffer, int
max_values) {
int PlainBooleanDecoder::Decode(bool* buffer, int max_values) {
max_values = std::min(max_values, num_values_);
- if (bit_reader_->GetBatch(1, buffer, max_values) != max_values) {
- ParquetException::EofException();
- }
- num_values_ -= max_values;
- return max_values;
+ int num_values_read = bit_reader_->GetBatch(1, buffer, max_values);
Review Comment:
IIUC, user can pass any `max_values` but `Decode` guarantees that returned
values will not exceed the number of remaining values.
> Actually, it would require outsize to provide the right value.
Column reader does know the number of remaining values in advance. It is
obtained from page header, isn't it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]