tustvold commented on issue #4781: URL: https://github.com/apache/arrow-rs/issues/4781#issuecomment-1707284805
> dynamic scalar is given the kernels are now dynamically typed It is the slightly funny type coercion that makes me uncomfortable, it seems strange to me that I'd be able to create a TimestampNanosecondArray from a float, or a u64, etc... _A lesser point is that this won't work for Decimal256._ I don't have a good solution here, I can appreciate the importance of making it easy to create scalars representing zero, and possibly other values like 1 or -1, I'm just not sure how best to express this > pub struct ScalarDatum FWIW this could just be `Scalar<ArrayRef>` > https://github.com/influxdata/influxdb_iox/blob/2a71fcbc76a695b1129895932746084a0a258bab/iox_query_influxql/src/window/non_negative.rs#L59-L60 I appreciate this is not a general solution, but in this particular case we can see two lines above that there are only two possible output types, which could simply be enumerated. This would also likely be significantly faster. Also not a great solution but you could just use `ScalarValue::new_zero` :sweat_smile: -- 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]
