tustvold commented on code in PR #4704:
URL: https://github.com/apache/arrow-rs/pull/4704#discussion_r1296007919
##########
arrow-array/src/scalar.rs:
##########
@@ -101,22 +101,23 @@ impl Datum for &dyn Array {
/// A wrapper around a single value [`Array`] indicating kernels should treat
it as a scalar value
///
/// See [`Datum`] for more information
-pub struct Scalar<'a>(&'a dyn Array);
+#[derive(Debug, Copy, Clone)]
+pub struct Scalar<T: Array>(T);
Review Comment:
> make some version of the function from
I don't follow this, why would they need to be creating a scalar from a mix
of a concrete rust type and an arrow `DataType`? That function is a temporary
compatibility shim to map the old scalar comparison kernels onto the new scalar
APIs, and will be deleted in the near future.
The major reason I'm pushing back on this is it opens up a can of worms
about how do you specify which particular `ArrowPrimitiveType`, or
`OffsetSize`, you want, or any metadata like timezones, etc... By keeping
things array based we avoid all that nonsense
--
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]