[ 
https://issues.apache.org/jira/browse/ARROW-9826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17191943#comment-17191943
 ] 

Jorge commented on ARROW-9826:
------------------------------

> Generally speaking if arrays are immutable, there are some operations that 
> should directly modify elements at specific index.

if arrays as immutable, there should be _no_ operations that modify its 
elements, right?

I also understood that arrays are immutable. Some general reasons is that this 
allows to pass slices of data by reference, both within a thread and across 
threads, without the need to worry about data races or threads waiting around. 
It is a whole computational model.

In rust, it allow us to use {{Arc}} to safely share arrays across threads, as 
otherwise we would need a Mutex or other mechanism.

To "modify" elements, we create a new array with the modified elements (see 
e.g. {{src/compute}}).

 

 

> [Rust] add set function to PrimitiveArray
> -----------------------------------------
>
>                 Key: ARROW-9826
>                 URL: https://issues.apache.org/jira/browse/ARROW-9826
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Rust
>    Affects Versions: 1.0.0
>            Reporter: Francesco Gadaleta
>            Priority: Major
>
> For in-place value replacement in Array, a `set()` function (maybe unsafe?) 
> would be required.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to