Example usage for org.apache.spark.sql.catalyst.expressions UnsafeRow getDecimal

List of usage examples for org.apache.spark.sql.catalyst.expressions UnsafeRow getDecimal

Introduction

In this page you can find the example usage for org.apache.spark.sql.catalyst.expressions UnsafeRow getDecimal.

Prototype

@Override
    public Decimal getDecimal(int ordinal, int precision, int scale) 

Source Link

Usage

From source file:com.splicemachine.db.iapi.types.SQLDecimal.java

License:Apache License

/**
 *
 * Read from a Project Tungsten Format (UnsafeRow).
 *
 * @see UnsafeRow#getDecimal(int, int, int)
 *
 * @param unsafeRow/*from   w w  w. j av a  2s . c  o m*/
 * @param ordinal
 * @throws StandardException
  */
@Override
public void read(UnsafeRow unsafeRow, int ordinal) throws StandardException {
    if (unsafeRow.isNullAt(ordinal))
        setToNull();
    else {
        isNull = false;
        value = unsafeRow.getDecimal(ordinal, precision, scale).toJavaBigDecimal();
    }
}