You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2023/03/22 02:50:24 UTC

[GitHub] [arrow] mapleFU commented on a diff in pull request #34668: GH-34667: [C++][Parquet] Test DeltaLengthByteArrayDecoder with invalid inputs

mapleFU commented on code in PR #34668:
URL: https://github.com/apache/arrow/pull/34668#discussion_r1144176635


##########
cpp/src/parquet/encoding.cc:
##########
@@ -2708,7 +2708,14 @@ class DeltaLengthByteArrayDecoder : public DecoderImpl,
 
   void SetData(int num_values, const uint8_t* data, int len) override {
     num_values_ = num_values;
-    if (len == 0) return;
+    if (len == 0) {
+      if (num_values > 0) {
+        throw ParquetException(
+            "Delta length byte array page was empty, but expected {num_values} values.");

Review Comment:
   I think num_values could greater than 0, let me write a test for that



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org