[
https://issues.apache.org/jira/browse/ORC-43?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167256#comment-15167256
]
ASF GitHub Bot commented on ORC-43:
-----------------------------------
Github user asandryh commented on a diff in the pull request:
https://github.com/apache/orc/pull/19#discussion_r54102507
--- Diff: tools/src/FileMemory.cc ---
@@ -95,37 +127,11 @@ int main(int argc, char* argv[]) {
return 1;
}
- orc::ReaderOptions opts;
- if (cols.size() > 0) {
- opts.include(cols);
- }
- std::unique_ptr<orc::MemoryPool> pool(new TestMemoryPool());
- opts.setMemoryPool(*(pool.get()));
-
- std::unique_ptr<orc::Reader> reader;
- try{
- reader = orc::createReader(orc::readLocalFile(std::string(filename)),
opts);
- } catch (orc::ParseError e) {
- std::cout << "Error reading file " << filename << "! " << e.what() <<
"\n";
- return -1;
- }
-
- std::unique_ptr<orc::ColumnVectorBatch> batch =
- reader->createRowBatch(batchSize);
- uint64_t readerMemory = reader->getMemoryUse();
- uint64_t batchMemory = batch->getMemoryUsage();
- while (reader->next(*batch)) {}
- uint64_t actualMemory =
- static_cast<TestMemoryPool*>(pool.get())->getMaxMemory();
- std::cout << "Reader memory estimate: " << readerMemory
- << "\nBatch memory estimate: " ;
- if (batch->hasVariableLength()) {
- std::cout << "Cannot estimate because reading ARRAY or MAP columns";
- } else {
- std::cout << batchMemory
- << "\nTotal memory estimate: " << readerMemory +
batchMemory;
+ try {
+ processFile(filename, cols, batchSize);
+ return 0;
+ } catch (std::exception& ex) {
+ std::cerr << "Caught exception: " << ex.what() << "\n";
+ return 1;
}
- std::cout << "\nActual max memory used: " << actualMemory << "\n";
-
- return 0;
--- End diff --
Don't you get a compiler error if you remove this `return 0;` statement?
It's unreachable, but some compilers can still complain.
> FileMemory.cc throws uncaught exception
> ---------------------------------------
>
> Key: ORC-43
> URL: https://issues.apache.org/jira/browse/ORC-43
> Project: Orc
> Issue Type: Bug
> Components: tools
> Affects Versions: 1.0.0
> Reporter: Owen O'Malley
> Assignee: Owen O'Malley
> Fix For: 1.0.1
>
>
> I ran a Coverity scan over ORC 1.0.0 and it found an issue in FileMemory
> where exceptions aren't be caught.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)