ffacs commented on code in PR #2048:
URL: https://github.com/apache/orc/pull/2048#discussion_r1835887782
##########
c++/include/orc/Reader.hh:
##########
@@ -39,6 +39,13 @@ namespace orc {
// classes that hold data members so we can maintain binary compatibility
struct ReaderOptionsPrivate;
struct RowReaderOptionsPrivate;
+ struct CacheOptions;
+ class InputStream;
+
+ namespace proto {
Review Comment:
Remove this
##########
c++/src/Reader.cc:
##########
@@ -1523,6 +1525,77 @@ namespace orc {
return ret;
}
+ void ReaderImpl::releaseBuffer(uint64_t boundary) {
+ if (readCache_) {
+ readCache_->evictEntriesBefore(boundary);
+ }
+ }
+
+ void ReaderImpl::preBuffer(const std::vector<int>& stripes,
+ const std::list<uint64_t>& includeTypes, const
CacheOptions& options) {
+ if (stripes.empty() || includeTypes.empty()) {
+ return;
+ }
+
+ orc::RowReaderOptions rowReaderOptions;
+ rowReaderOptions.includeTypes(includeTypes);
+ ColumnSelector columnSelector(contents_.get());
+ std::vector<bool> selectedColumns;
+ columnSelector.updateSelected(selectedColumns, rowReaderOptions);
+
+ std::vector<ReadRange> ranges;
+ ranges.reserve(includeTypes.size());
+ for (auto stripe : stripes) {
+ // get stripe information
+ const auto& stripeInfo = footer_->stripes(stripe);
+ uint64_t stripe_footer_start =
Review Comment:
Please keep the naming style
##########
c++/src/Reader.cc:
##########
@@ -1523,6 +1525,77 @@ namespace orc {
return ret;
}
+ void ReaderImpl::releaseBuffer(uint64_t boundary) {
+ if (readCache_) {
+ readCache_->evictEntriesBefore(boundary);
+ }
+ }
+
+ void ReaderImpl::preBuffer(const std::vector<int>& stripes,
+ const std::list<uint64_t>& includeTypes, const
CacheOptions& options) {
+ if (stripes.empty() || includeTypes.empty()) {
+ return;
+ }
+
+ orc::RowReaderOptions rowReaderOptions;
+ rowReaderOptions.includeTypes(includeTypes);
+ ColumnSelector columnSelector(contents_.get());
+ std::vector<bool> selectedColumns;
+ columnSelector.updateSelected(selectedColumns, rowReaderOptions);
+
+ std::vector<ReadRange> ranges;
+ ranges.reserve(includeTypes.size());
+ for (auto stripe : stripes) {
+ // get stripe information
+ const auto& stripeInfo = footer_->stripes(stripe);
+ uint64_t stripe_footer_start =
+ stripeInfo.offset() + stripeInfo.index_length() +
stripeInfo.data_length();
+ uint64_t stripe_footer_length = stripeInfo.footer_length();
Review Comment:
ditto
--
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]