You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2021/11/16 10:58:41 UTC

[arrow] branch master updated: ARROW-14664: [C++] Fix accepted types for Parquet encoding DELTA_BYTE_ARRAY

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

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


The following commit(s) were added to refs/heads/master by this push:
     new f1fcc4f  ARROW-14664: [C++] Fix accepted types for Parquet encoding DELTA_BYTE_ARRAY
f1fcc4f is described below

commit f1fcc4f2bfe5b115bda96fa547da4c0b4328685c
Author: Antoine Pitrou <an...@python.org>
AuthorDate: Tue Nov 16 11:57:09 2021 +0100

    ARROW-14664: [C++] Fix accepted types for Parquet encoding DELTA_BYTE_ARRAY
    
    DELTA_BYTE_ARRAY is only applicable to BYTE_ARRAY but we would also accept FIXED_LEN_BYTE_ARRAY.
    Casting the decoder to the expected subtype would then produce a null pointer.
    
    Found by OSS-Fuzz.  Should fix the following issue:
    - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40865
    
    Closes #11664 from pitrou/ARROW-14664-parquet-encoding
    
    Authored-by: Antoine Pitrou <an...@python.org>
    Signed-off-by: Antoine Pitrou <an...@python.org>
---
 cpp/src/parquet/encoding.cc | 5 ++---
 testing                     | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/cpp/src/parquet/encoding.cc b/cpp/src/parquet/encoding.cc
index 3ff5942..549f356 100644
--- a/cpp/src/parquet/encoding.cc
+++ b/cpp/src/parquet/encoding.cc
@@ -2709,11 +2709,10 @@ std::unique_ptr<Decoder> MakeDecoder(Type::type type_num, Encoding::type encodin
         break;
     }
   } else if (encoding == Encoding::DELTA_BYTE_ARRAY) {
-    if (type_num == Type::BYTE_ARRAY || type_num == Type::FIXED_LEN_BYTE_ARRAY) {
+    if (type_num == Type::BYTE_ARRAY) {
       return std::unique_ptr<Decoder>(new DeltaByteArrayDecoder(descr));
     }
-    throw ParquetException(
-        "DELTA_BYTE_ARRAY only supports BYTE_ARRAY and FIXED_LEN_BYTE_ARRAY");
+    throw ParquetException("DELTA_BYTE_ARRAY only supports BYTE_ARRAY");
   } else {
     ParquetException::NYI("Selected encoding is not supported");
   }
diff --git a/testing b/testing
index a51d878..065f6f2 160000
--- a/testing
+++ b/testing
@@ -1 +1 @@
-Subproject commit a51d8788cf34994ef88c81cffb11117a949350ef
+Subproject commit 065f6f2019b7523dd0f68430790073d4ede5a058