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


##########
cpp/src/arrow/scalar.h:
##########
@@ -245,41 +250,51 @@ struct ARROW_EXPORT DoubleScalar : public 
NumericScalar<DoubleType> {
   using NumericScalar<DoubleType>::NumericScalar;
 };
 
-struct ARROW_EXPORT BaseBinaryScalar
-    : public internal::PrimitiveScalarBase,
-      private internal::ArraySpanFillFromScalarScratchSpace {
-  using internal::PrimitiveScalarBase::PrimitiveScalarBase;
+struct ARROW_EXPORT BaseBinaryScalar : public internal::PrimitiveScalarBase {
   using ValueType = std::shared_ptr<Buffer>;
 
-  std::shared_ptr<Buffer> value;
+  // The value is not supposed to be modified after construction, because 
subclasses have
+  // a scratch space whose content need to be kept consistent with the value. 
It is also
+  // the user of this class's responsibility to ensure that the buffer is not 
written to
+  // accidentally.
+  const std::shared_ptr<Buffer> value = NULLPTR;

Review Comment:
   so this actually means `const std::shared_ptr<const Buffer> value = 
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