alamb commented on issue #97:
URL: https://github.com/apache/arrow-rs/issues/97#issuecomment-826798446
Comment from Neville Dipale(nevi_me) @ 2020-08-25T03:59:35.414+0000:
<pre>Once arrays are built, they're meant to be immutable. Wouldn't this
better belong in ArrayBuilder?</pre>
Comment from Francesco Gadaleta(frag) @ 2020-08-26T13:05:41.441+0000:
<pre>Yes, it makes sense to me.
Generally speaking if arrays are immutable, there are some operations that
should directly modify elements at specific index.
How are you going about that?
</pre>
Comment from Paddy Horan(paddyhoran) @ 2020-09-07T02:50:04.369+0000:
<pre>Essentially, we are not addressing that. I don't believe any of the
other implementations support this. It's kind of against the general
principles of Arrow.
However, there is nothing stopping you adding this for yourself in your
application. You have access to underlying buffers. We are trailing behind
the C++ impl in terms of what we support in Rust so we will likely focus on
"catching up" for now.</pre>
Comment from Jorge Leitão(jorgecarleitao) @ 2020-09-08T04:16:41.818+0000:
<pre>> 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}}).
</pre>
Comment from Francesco Gadaleta(frag) @ 2020-09-08T07:13:00.133+0000:
<pre>But that can be extremely inefficient. If one needs to change a dozen
values in a column of millions of elements, that can become prohibitive.
In-place value changes are quite a common operation in data science.
</pre>
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]