Example #1
0
        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);
        }
Example #2
0
        private static double Sum(Decimal128Array decimal128Array)
        {
            double sum = 0;

            for (int valueIndex = 0; valueIndex < decimal128Array.Length; valueIndex++)
            {
                sum += (double)decimal128Array.GetValue(valueIndex);
            }
            return(sum);
        }
Example #3
0
 public void Visit(Decimal128Array array) => CompareArrays(array);
Example #4
0
 public void Visit(Decimal128Array array)
 {
     _buffers.Add(CreateBuffer(array.NullBitmapBuffer));
     _buffers.Add(CreateBuffer(array.ValueBuffer));
 }