File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,13 @@ use arrow::record_batch::RecordBatch;
2424use datafusion_common:: ScalarValue ;
2525use std:: sync:: Arc ;
2626
27- /// Represents the result from an expression
28- #[ derive( Clone ) ]
27+ /// Represents the result of evaluating an expression: either a single
28+ /// `ScalarValue` or an [`ArrayRef`].
29+ ///
30+ /// While a [`ColumnarValue`] can always be converted into an array
31+ /// for convenience, it is often much more performant to provide an
32+ /// optimized path for scalar values.
33+ #[ derive( Clone , Debug ) ]
2934pub enum ColumnarValue {
3035 /// Array of values
3136 Array ( ArrayRef ) ,
@@ -41,7 +46,8 @@ impl ColumnarValue {
4146 }
4247 }
4348
44- /// Convert a columnar value into an ArrayRef
49+ /// Convert a columnar value into an ArrayRef. [`Self::Scalar`] is
50+ /// converted by repeating the same scalar multiple times.
4551 pub fn into_array ( self , num_rows : usize ) -> ArrayRef {
4652 match self {
4753 ColumnarValue :: Array ( array) => array,
You can’t perform that action at this time.
0 commit comments