parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject parquet-cpp git commit: PARQUET-789: Catch/translate ParquetExceptions in parquet::arrow::FileReader
Date Tue, 06 Dec 2016 16:42:45 GMT
Repository: parquet-cpp
Updated Branches:
  refs/heads/master 51408aeea -> 641984e6d


PARQUET-789: Catch/translate ParquetExceptions in parquet::arrow::FileReader

I ran into this issue when debugging ARROW-406. I also changed the translated status type
to `IOError` if that makes sense.

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #201 from wesm/PARQUET-789 and squashes the following commits:

67a8c58 [Wes McKinney] Catch ParquetException in parquet::arrow FileReader::ReadFlatColumn/ReadFlatTable


Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/641984e6
Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/641984e6
Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/641984e6

Branch: refs/heads/master
Commit: 641984e6d7fd6305c281112063e2444756bbdba8
Parents: 51408ae
Author: Wes McKinney <wes.mckinney@twosigma.com>
Authored: Tue Dec 6 11:42:37 2016 -0500
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Tue Dec 6 11:42:37 2016 -0500

----------------------------------------------------------------------
 src/parquet/arrow/reader.cc | 12 ++++++++++--
 src/parquet/arrow/utils.h   | 10 +++++-----
 2 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/641984e6/src/parquet/arrow/reader.cc
----------------------------------------------------------------------
diff --git a/src/parquet/arrow/reader.cc b/src/parquet/arrow/reader.cc
index 2d2b5cd..35afb47 100644
--- a/src/parquet/arrow/reader.cc
+++ b/src/parquet/arrow/reader.cc
@@ -201,11 +201,19 @@ Status FileReader::GetFlatColumn(int i, std::unique_ptr<FlatColumnReader>*
out)
 }
 
 Status FileReader::ReadFlatColumn(int i, std::shared_ptr<Array>* out) {
-  return impl_->ReadFlatColumn(i, out);
+  try {
+    return impl_->ReadFlatColumn(i, out);
+  } catch (const ::parquet::ParquetException& e) {
+    return ::arrow::Status::IOError(e.what());
+  }
 }
 
 Status FileReader::ReadFlatTable(std::shared_ptr<Table>* out) {
-  return impl_->ReadFlatTable(out);
+  try {
+    return impl_->ReadFlatTable(out);
+  } catch (const ::parquet::ParquetException& e) {
+    return ::arrow::Status::IOError(e.what());
+  }
 }
 
 const ParquetFileReader* FileReader::parquet_reader() const {

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/641984e6/src/parquet/arrow/utils.h
----------------------------------------------------------------------
diff --git a/src/parquet/arrow/utils.h b/src/parquet/arrow/utils.h
index bd53792..87f39b0 100644
--- a/src/parquet/arrow/utils.h
+++ b/src/parquet/arrow/utils.h
@@ -26,11 +26,11 @@
 namespace parquet {
 namespace arrow {
 
-#define PARQUET_CATCH_NOT_OK(s)                    \
-  try {                                            \
-    (s);                                           \
-  } catch (const ::parquet::ParquetException& e) { \
-    return ::arrow::Status::Invalid(e.what());     \
+#define PARQUET_CATCH_NOT_OK(s)                     \
+  try {                                             \
+    (s);                                            \
+  } catch (const ::parquet::ParquetException& e) {  \
+    return ::arrow::Status::IOError(e.what());      \
   }
 
 #define PARQUET_IGNORE_NOT_OK(s) \


Mime
View raw message