spiraldb / vortex

A toolkit for working with compressed Arrow in-memory, on-disk, and over-the-wire. "The LLVM of file formats"
Apache License 2.0
151 stars 8 forks source link

Make IntoArrayVariant chain more explicit #507

Open a10y opened 1 month ago

a10y commented 1 month ago

Currently we implement IntoArrayVariant for all T: IntoCanonical by first calling into_canonical and then downcasting. This hides that there is a potentially expensive decoding step going on.

We should either remove the shortcut method, or rename the methods to make it clearer that they can be expensive

robert3005 commented 1 month ago

Strong preference for single methods to avoid long chains. Need a good name though and likely will deviate from rust conventions

a10y commented 1 month ago

some options:

Another option is to replace methods with top-level function calls, e.g. canonical::to_primitive(array)