This is an automated email from the ASF dual-hosted git repository.
gangwu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/main by this push:
new cfa7498 MINOR: [C++] Fix orc-scan tool and install more tools
cfa7498 is described below
commit cfa749854fd4fd78c763762f3515f33b9a206072
Author: yan.zhang <[email protected]>
AuthorDate: Fri Apr 23 17:01:35 2021 +0800
MINOR: [C++] Fix orc-scan tool and install more tools
This closes #690
---
c++/src/OrcHdfsFile.cc | 4 +++-
tools/src/CMakeLists.txt | 4 ++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/c++/src/OrcHdfsFile.cc b/c++/src/OrcHdfsFile.cc
index 58027c7..fff6109 100644
--- a/c++/src/OrcHdfsFile.cc
+++ b/c++/src/OrcHdfsFile.cc
@@ -142,18 +142,20 @@ namespace orc {
throw ParseError("Buffer is null");
}
+ char* buf_ptr = reinterpret_cast<char*>(buf);
hdfs::Status status;
size_t total_bytes_read = 0;
size_t last_bytes_read = 0;
do {
- status = file->PositionRead(buf,
+ status = file->PositionRead(buf_ptr,
static_cast<size_t>(length) - total_bytes_read,
static_cast<off_t>(offset + total_bytes_read), &last_bytes_read);
if(!status.ok()) {
throw ParseError("Error reading the file: " + status.ToString());
}
total_bytes_read += last_bytes_read;
+ buf_ptr += last_bytes_read;
} while (total_bytes_read < length);
}
diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt
index 4b6768c..6cfb950 100644
--- a/tools/src/CMakeLists.txt
+++ b/tools/src/CMakeLists.txt
@@ -94,4 +94,8 @@ install(TARGETS
orc-contents
orc-metadata
orc-statistics
+ orc-scan
+ orc-memory
+ timezone-dump
+ csv-import
DESTINATION bin)