mapleFU commented on code in PR #37874:
URL: https://github.com/apache/arrow/pull/37874#discussion_r1341269097
##########
cpp/src/parquet/encoding.cc:
##########
@@ -3382,6 +3385,20 @@ 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) {
+ prefix = std::string_view{buffer[i]};
+ continue;
+ }
+ if (buffer[i].len == 0 && prefix.data() != last_value_.data()) {
+ // postfix length == 0, point to the prefix.
+ // If prefix.data() == last_value_.data(), buffer might point to
+ // the last_value_, and last_value_ will be changed at the end
+ // of GetInternal. So we need to copy the prefix to the buffer.
Review Comment:
This part is weird, I want to know what do you think of this... Currently I
use a hack `prefix.data() != last_value_.data()` here.
--
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]