Re:Apache Arrow 3.0
by mumblemumble on Wednesday February 03, 2021 @05:09PM
(#26019813)
It's not just a serde. One of its key use cases is eliminating serde.
[ Parent
| on HN ]
Arrow had it selling points as non-serde. But I am wondering how does it achieve no-serde with Python? By allocating PyObject cleverly with a network packet buffer?
If I convert an Arrow int8 array to normal python list of int's, will this involve copying?
I think the idea is that you'd have a Python object that behaves exactly like a list of ints would, but with Arrow as its backing store.
Re:Apache Arrow 3.0
by kylebarron on Wednesday February 03, 2021 @11:29PM
(#26022590)
This is similar to Numpy. You operate on Python objects that describe the Numpy structure, but the actual memory is stored in C objects, not Python objects.
It would have to, but to a numpy vector, maybe not.
Re:Apache Arrow 3.0
by waynesonfire on Wednesday February 03, 2021 @05:10PM
(#26019824)
I just don't believe you. My CPU doesn't understand Apache Arrow 3.0.
Re:Apache Arrow 3.0
by kristjansson on Wednesday February 03, 2021 @05:26PM
(#26020010)
Not GP post, but it might have been better stated as 'eliminating serde overhead'. Arrow's RPC serialization [1] is basically Protobuf, with a whole lot of hacks to eliminate copies on both ends of the wire. So it's still 'serde', but markedly more efficient for large blocks of tabular-ish data.
> Arrow's serialization is Protobuf
Incorrect. Only Arrow Flight embeds the Arrow wire format in a Protocol Buffer, but the Arrow protocol itself does not use Protobuf.
Re:Apache Arrow 3.0
by kristjansson on Wednesday February 03, 2021 @05:50PM
(#26020279)
Apologies, off base there. Edited with a pointer to Flight :)
Re:Apache Arrow 3.0
by mumblemumble on Wednesday February 03, 2021 @05:36PM
(#26020119)
So, there are several components to Arrow. One of them transfers data using IPC, and naturally needs to serialize. The other uses shared memory, which eliminates the need for serde.
Sadly, the latter isn't (yet) well supported anywhere but Python and C++. If you can/do use it, though, data are just kept as as arrays in memory. Which is exactly what the CPU wants to see.
Re:Apache Arrow 3.0
by superdimwit on Wednesday February 03, 2021 @08:21PM
(#26021454)
Shared memory format is supported in Julia too!
Re:Apache Arrow 3.0
by mumblemumble on Wednesday February 03, 2021 @08:44PM
(#26021594)
Oh, that's fantastic to hear. Right now I'm living in Python because that's the galactic center, but I've also been anxious to find a low-cost escape hatch that doesn't just lead to C++.
Re:Apache Arrow 3.0
by oscardssmith on Wednesday February 03, 2021 @11:37PM
(#26022655)
You should definitely check out Julia then. There are a few parts of the language that use C/C++ libraries (blas and mpfr are the main ones), but 95% of the time, your stack will be Julia all the way down.
In the best case, your CPU needn't really be involved beyond a call to set up mapped memory. It is (among other things) a common memory format, so you can be working with it in one framework, and then start working with it in another, and it's location and format in memory hasn't changed at all.