polars icon indicating copy to clipboard operation
polars copied to clipboard

Implement Byte Vector Values

Open ozgrakkurt opened this issue 1 year ago • 3 comments

Problem Description

Currently only string is supported but it would be nice to have support for byte vectors

ozgrakkurt avatar Sep 16 '22 14:09 ozgrakkurt

I think you can use List<u8> for that. Physically it is exact the same as our string type.

ritchie46 avatar Sep 16 '22 15:09 ritchie46

How would I do something like binary_col.is_in(list_of_binary_literals) ? I can create a single binary literal like this: binary_vec.iter().collect::<polars::series::Series>().lit() but not sure how to create a List<List> literal

Also maybe Literal trait should be implemented for Vec<u8> and &[u8] ?

ozgrakkurt avatar Sep 16 '22 19:09 ozgrakkurt

@ritchie46 currently arrow binary datatype isn't supported.

not implemented here: https://github.com/pola-rs/polars/blob/4beb08eba86bfcf8924d1d484fccb78b94c0e48e/polars/polars-core/src/datatypes/field.rs#L113

also here: https://github.com/pola-rs/polars/blob/4beb08eba86bfcf8924d1d484fccb78b94c0e48e/polars/polars-core/src/datatypes/dtype.rs#L6

ozgrakkurt avatar Sep 18 '22 11:09 ozgrakkurt