List of usage examples for org.apache.spark.sql.catalyst.expressions UnsafeRow getLong
@Override
public long getLong(int ordinal)
From source file:com.splicemachine.db.iapi.types.SQLLongint.java
License:Apache License
@Override public void read(UnsafeRow unsafeRow, int ordinal) throws StandardException { if (unsafeRow.isNullAt(ordinal)) setToNull();//from w w w.j a va2s . c o m else { isNull = false; value = unsafeRow.getLong(ordinal); } }
From source file:com.splicemachine.db.iapi.types.SQLTime.java
License:Apache License
/** * * Read data into a Project Tungsten Format (UnsafeRow). We read * data as two ints.//from w ww.j a v a 2s. co m * * @param unsafeRow * @param ordinal * @throws StandardException */ @Override public void read(UnsafeRow unsafeRow, int ordinal) throws StandardException { if (unsafeRow.isNullAt(ordinal)) setToNull(); else { long offsetAndSize = unsafeRow.getLong(ordinal); int offset = (int) (offsetAndSize >> 32); encodedTime = Platform.getInt(unsafeRow.getBaseObject(), unsafeRow.getBaseOffset() + (long) offset); encodedTimeFraction = Platform.getInt(unsafeRow.getBaseObject(), unsafeRow.getBaseOffset() + (long) offset + 4L); isNull = false; } }
From source file:com.splicemachine.db.iapi.types.SQLTimestamp.java
License:Apache License
/** * * Read from Project Tungsten format (UnsafeRow). Timestamp is * read as 3 ints.// w w w. j a v a 2 s. c om * * * @param unsafeRow * @param ordinal */ @Override public void read(UnsafeRow unsafeRow, int ordinal) throws StandardException { if (unsafeRow.isNullAt(ordinal)) setToNull(); else { long offsetAndSize = unsafeRow.getLong(ordinal); int offset = (int) (offsetAndSize >> 32); encodedDate = Platform.getInt(unsafeRow.getBaseObject(), unsafeRow.getBaseOffset() + (long) offset); encodedTime = Platform.getInt(unsafeRow.getBaseObject(), unsafeRow.getBaseOffset() + (long) offset + 4L); nanos = Platform.getInt(unsafeRow.getBaseObject(), unsafeRow.getBaseOffset() + (long) offset + 8L); isNull = false; } }