You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by ga...@apache.org on 2019/06/15 05:06:30 UTC

[orc] branch master updated: ORC-514: [C++] Malformed RowIndex stream meta exception when read statistics from stripe with bloom filter

This is an automated email from the ASF dual-hosted git repository.

gangwu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c5a020  ORC-514: [C++] Malformed RowIndex stream meta exception when read statistics from stripe with bloom filter
1c5a020 is described below

commit 1c5a020382059b9fea3344ffe428b1f8986b0a12
Author: Renat Valiullin <ri...@gmail.com>
AuthorDate: Fri Jun 14 22:06:25 2019 -0700

    ORC-514: [C++] Malformed RowIndex stream meta exception when read statistics from stripe with bloom filter
    
    This fixes #399
---
 c++/include/orc/Common.hh | 3 ++-
 c++/src/Reader.cc         | 3 ++-
 c++/src/Writer.cc         | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/c++/include/orc/Common.hh b/c++/include/orc/Common.hh
index 97eac9e..ca926cf 100644
--- a/c++/include/orc/Common.hh
+++ b/c++/include/orc/Common.hh
@@ -111,7 +111,8 @@ namespace orc {
     StreamKind_DICTIONARY_COUNT = 4,
     StreamKind_SECONDARY = 5,
     StreamKind_ROW_INDEX = 6,
-    StreamKind_BLOOM_FILTER = 7
+    StreamKind_BLOOM_FILTER = 7,
+    StreamKind_BLOOM_FILTER_UTF8 = 8
   };
 
   /**
diff --git a/c++/src/Reader.cc b/c++/src/Reader.cc
index de0e701..c5627a7 100644
--- a/c++/src/Reader.cc
+++ b/c++/src/Reader.cc
@@ -499,8 +499,9 @@ namespace orc {
     uint64_t indexEnd = stripeInfo.offset() + stripeInfo.indexlength();
     for (int i = 0; i < num_streams; i++) {
       const proto::Stream& stream = currentStripeFooter.streams(i);
+      StreamKind streamKind = static_cast<StreamKind>(stream.kind());
       uint64_t length = static_cast<uint64_t>(stream.length());
-      if (static_cast<StreamKind>(stream.kind()) == StreamKind::StreamKind_ROW_INDEX) {
+      if (streamKind == StreamKind::StreamKind_ROW_INDEX) {
         if (offset + length > indexEnd) {
           std::stringstream msg;
           msg << "Malformed RowIndex stream meta in stripe " << stripeIndex
diff --git a/c++/src/Writer.cc b/c++/src/Writer.cc
index 826334b..8158990 100644
--- a/c++/src/Writer.cc
+++ b/c++/src/Writer.cc
@@ -464,7 +464,8 @@ namespace orc {
     uint64_t dataLength = 0;
     uint64_t indexLength = 0;
     for (uint32_t i = 0; i < streams.size(); ++i) {
-      if (streams[i].kind() == proto::Stream_Kind_ROW_INDEX) {
+      if (streams[i].kind() == proto::Stream_Kind_ROW_INDEX ||
+          streams[i].kind() == proto::Stream_Kind_BLOOM_FILTER_UTF8) {
         indexLength += streams[i].length();
       } else {
         dataLength += streams[i].length();