Github user AnatoliShein commented on a diff in the pull request:
https://github.com/apache/orc/pull/134#discussion_r125901693
--- Diff: c++/src/OrcHdfsFile.cc ---
@@ -123,17 +123,21 @@ namespace orc {
uint64_t length,
uint64_t offset) override {
- size_t last_bytes_read = 0;
-
if (!buf) {
throw ParseError("Buffer is null");
}
hdfs::Status status;
- status = file->PositionRead(buf, static_cast<size_t>(length),
static_cast<off_t>(offset), &last_bytes_read);
- if(!status.ok()) {
- throw ParseError("Error reading the file: " + status.ToString());
- }
+ size_t total_bytes_read = 0;
+ size_t last_bytes_read = 0;
+
+ do {
+ status = file->PositionRead(buf, static_cast<size_t>(length) -
total_bytes_read, static_cast<off_t>(offset + total_bytes_read),
&last_bytes_read);
--- End diff --
Just fixed the whole file to wrap on 80 chars.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---