viirya commented on code in PR #8378:
URL: https://github.com/apache/arrow-datafusion/pull/8378#discussion_r1411317472
##########
datafusion/common/src/scalar.rs:
##########
@@ -50,9 +50,52 @@ use arrow::{
use arrow_array::cast::as_list_array;
use arrow_array::{ArrowNativeTypeOp, Scalar};
-/// Represents a dynamically typed, nullable single value.
-/// This is the single-valued counter-part to arrow's [`Array`].
+/// A dynamically typed, nullable single value, (the single-valued counter-part
+/// to arrow's [`Array`])
///
+/// # Performance
+///
+/// In general, please use arrow [`Array`]s rather than [`ScalarValue`]
whenever
+/// possible, as it is far more efficient for multiple values.
+///
+/// # Example
+/// ```
+/// # use datafusion_common::ScalarValue;
+/// // Create single scalar value for an Int32 value
+/// let s1 = ScalarValue::Int32(Some(10));
+///
+/// // you an also create values using the From impl:
Review Comment:
```suggestion
/// // You an also create values using the From impl:
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]