Live data from Hacker News

Why Polars rewrote its Arrow string data type

pola.rs

1–10 of 70 posts

Re: Why Polars rewrote its Arrow string data type

#4

Is there a standalone c/c++ implementation of this string type anywhere?

It looks a lot like cedarDB's "german strings".

https://cedardb.com/blog/german_strings/>

You could probably write a C++ implementation based on the article.

Note that it's not all that useful if you don't plan on searching for text based on their prefix. From my understanding, this is mostly a better way to store SStables in RAM/partially on disk if you mmap.

Re: Why Polars rewrote its Arrow string data type

#9

I might have missed it in the article but I'm not sure why the prefix is stored for strings that can't be inlined.

Ctrl-F for "Some motivations are as follows" under the "String view with short string optimizations" section here: https://docs.google.com/document/d/12aZi8Inez9L_JCtZ6gi2XDbQ...

Copying here:

> Having the 4-byte prefix directly accessible (without indirection through an offset into a separate data buffer) can substantially improve the performance of comparisons returning false. This prefix can be encoded with multi-column hash keys to accelerate aggregations, joins. Sorts would likely also be significantly faster with this representation (experiments would tell for certain)

> Certain algorithms (for example “prefix of string” or “suffix of string” — e.g. PREFIX(“foobar”, 3) -> “bar”) can execute by manipulating StringView values only and not requiring any memory copying of large strings.

This document was an early proposal for adding what is now called the StringView (and ByteView) types to the Arrow format itself.

Post reply on HN