Re: [Rust] Creating Native Types from Rust Types (e.g. i32 -> ArrowNativeType)

2019-01-07 Thread Neville Dipale
Looks like I need the below in datatypes.rs impl From for Int32Type { fn from(value: i32) -> Self { value.into() } } Adding that to the `make_type` macro seems to have solved my problem. I can now implement things like `count`, `mean`, and a few more types of calculations and aggregations on arra

Re: [Rust] Creating Native Types from Rust Types (e.g. i32 -> ArrowNativeType)

2019-01-07 Thread Neville Dipale
Thanks Andy, I'm aware of that, and have tried it with no success. What I am looking for might be similar to ScalarValue in DataFusion. If I create an array like Int32Array::from(vec![1]), and try to get the first value from this array, I get the primitive 1i32 instead of what I'm looking for. O

Re: [Rust] Creating Native Types from Rust Types (e.g. i32 -> ArrowNativeType)

2019-01-07 Thread Andy Grove
It is possible to create an array of Arrow types from a vec of primitives e.g. Int32Array::from(vec![1, 2, 3]) IIRC. Andy. On Mon, Jan 7, 2019 at 5:09 AM Neville Dipale wrote: > I'm trying to find/create a way of converting primitive rust values in Rust > to their ArrowNativeType counterparts.

[Rust] Creating Native Types from Rust Types (e.g. i32 -> ArrowNativeType)

2019-01-07 Thread Neville Dipale
I'm trying to find/create a way of converting primitive rust values in Rust to their ArrowNativeType counterparts. I'm trying to implement some array ops which need constant values, so I can be able to multiply say a Int32Type by 3 to get a value. Is there currently a way of doing this that I don'