Optimize ColumnarValue::into_array
/ ScalarValue::to_array
/ ScalarValue::to_array_of_size
#13754
Labels
performance
Make DataFusion faster
When implementing functions,
ColumnarValue::into_array
/ScalarValue::to_array
/ScalarValue::to_array_of_size
are useful to reduce code complexity and denominate input arguments in terms of an array (either full-sized or 1-sized).The code to handle scalars of structural types is
datafusion/datafusion/common/src/scalar/mod.rs
Lines 2341 to 2354 in 049ca15
it's not optimized for the common case of input array (the scalar) being of length 1 and requested length also being 1.
In such case it could probably be reduced to
Arc::clone
The text was updated successfully, but these errors were encountered: