Example usage for org.apache.spark.sql.catalyst.expressions.codegen UnsafeRowWriter write

List of usage examples for org.apache.spark.sql.catalyst.expressions.codegen UnsafeRowWriter write

Introduction

In this page you can find the example usage for org.apache.spark.sql.catalyst.expressions.codegen UnsafeRowWriter write.

Prototype

@Override
    public void write(int ordinal, Decimal input, int precision, int scale) 

Source Link

Usage

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

License:Apache License

/**
 *
 * Write to a Project Tungsten Format (UnsafeRow).
 *
 * @see UnsafeRowWriter#write(int, Decimal, int, int)
 *
 * @param unsafeRowWriter//from   ww  w.jav  a 2s  . c  o  m
 * @param ordinal
  */
@Override
public void write(UnsafeRowWriter unsafeRowWriter, int ordinal) {
    if (isNull())
        unsafeRowWriter.setNullAt(ordinal);
    else {
        Decimal foobar = Decimal.apply(value, value.precision(), value.scale());
        unsafeRowWriter.write(ordinal, Decimal.apply(value, value.precision(), value.scale()),
                value.precision(), value.scale());
    }
}