zanmato1984 commented on PR #40237:
URL: https://github.com/apache/arrow/pull/40237#issuecomment-2041320144

   The current approach, i.e., immutable `value`, has some corner cases 
uncovered with `is_valid` being mutable.
   
   Say, a scalar instance is created with a valid value. Later setting its 
`is_valid` to `false` is fine because any attempt of using this scalar won't 
actually use the scratch space content. However it is not the case for the 
reverse: setting `is_valid` to `true` for an initially invalid scalar instance 
will leave the scratch space content inconsistent.
   
   One way around it could be leveraging `Scalar::Validate` or 
`Scalar::ValidateFull` to detect such inconsistency, supposing user code should 
call these method aggressively to check the scalar.


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