rok commented on code in PR #14341:
URL: https://github.com/apache/arrow/pull/14341#discussion_r1158124125


##########
cpp/src/parquet/encoding.cc:
##########
@@ -3149,9 +3160,14 @@ class DeltaByteArrayEncoder : public EncoderImpl, 
virtual public TypedEncoder<DT
           previous_len = src.len;
           prefix_length_encoder_.Put({static_cast<int32_t>(j)}, 1);
 
-          const uint8_t* suffix_ptr = src.ptr + j;
-          const uint32_t suffix_length = static_cast<uint32_t>(src.len - j);
           last_value_view = view;
+          const auto suffix_length = static_cast<uint32_t>(src.len - j);
+          const uint8_t* suffix_ptr;
+          if (suffix_length == 0) {
+            suffix_ptr = reinterpret_cast<const uint8_t*>("");

Review Comment:
   Indeed! Switched to `nullptr`.



-- 
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]

Reply via email to