private static double SumAllNumbers(RecordBatch recordBatch) { double sum = 0; for (int k = 0; k < recordBatch.ColumnCount; k++) { var array = recordBatch.Arrays.ElementAt(k); switch (recordBatch.Schema.GetFieldByIndex(k).DataType.TypeId) { case ArrowTypeId.Int64: Int64Array int64Array = (Int64Array)array; sum += Sum(int64Array); break; case ArrowTypeId.Double: DoubleArray doubleArray = (DoubleArray)array; sum += Sum(doubleArray); break; case ArrowTypeId.Decimal128: Decimal128Array decimalArray = (Decimal128Array)array; sum += Sum(decimalArray); break; } } return(sum); }
private static double Sum(Decimal128Array decimal128Array) { double sum = 0; for (int valueIndex = 0; valueIndex < decimal128Array.Length; valueIndex++) { sum += (double)decimal128Array.GetValue(valueIndex); } return(sum); }
public void Visit(Decimal128Array array) => CompareArrays(array);
public void Visit(Decimal128Array array) { _buffers.Add(CreateBuffer(array.NullBitmapBuffer)); _buffers.Add(CreateBuffer(array.ValueBuffer)); }