bkietz commented on code in PR #37874:
URL: https://github.com/apache/arrow/pull/37874#discussion_r1340273635
##########
cpp/src/parquet/encoding.cc:
##########
@@ -3382,6 +3385,17 @@ class DeltaByteArrayDecoderImpl : public DecoderImpl,
virtual public TypedDecode
if (ARROW_PREDICT_FALSE(static_cast<size_t>(prefix_len_ptr[i]) >
prefix.length())) {
throw ParquetException("prefix length too large in DELTA_BYTE_ARRAY");
}
+ if (prefix_len_ptr[i] == 0) {
Review Comment:
Maybe I'm missing something, but it seems that if we had `prefix_len_ptr[i]
== 0` but `buffer[i].len != 0` several times in a row, we'd skip copying some
buffers in. For example, in the case where the encoded array is `["aaa", "bbb",
"ccc", "cccddd"]` the prefix length would be 0 for the loop iteration
corresponding to "bbb" and we'd assign it to `prefix` and skip to the next
iteration... where the prefix length would still be 0 and we'd assign "ccc" to
`prefix` without copying anything
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]