-
-
Notifications
You must be signed in to change notification settings - Fork 751
Closed
Labels
Description
After calling an arrow::compute::ScalarAggregationFunction, it returns a Datum object which contains a Scalar object. However, there's no value() method in the generated java wrapper to retrieve the underlying value, e.g. long/int, etc.
My code:
ArrowBuf buf; // this is an int64 ArrowBuf java object initialized in java
// Below are all javacpp calls
ArrowBuffer buffer = new ArrowBuffer(buf.nioBuffer(), capacity);
ExecContext context = new ExecContext();
DataType type = int64();
PrimitiveArray array = new PrimitiveArray(type, capacity, buffer);
Function func = context.func_registry().GetFunction("sum").ValueOrDie();
DatumVector vector = new DatumVector(new Datum(array));
Scalar s = func.Execute(vector, null, context).ValueOrDie().scalar();
// How can I retrieve the `long` value from the Scalar result object here? Haven't found such methods from either Scalar or Int64Scalar classes.
Please help advice. Thanks very much.