@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class RowResult extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
index |
protected static int |
INDEX_RESET_LOCATION |
protected Schema |
schema |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNull(int columnIndex) |
protected void |
checkType(int columnIndex,
Type... types) |
protected void |
checkValidColumn(int columnIndex) |
abstract ByteBuffer |
getBinary(int columnIndex)
Get the specified column's binary data.
|
ByteBuffer |
getBinary(String columnName)
Get the specified column's binary data.
|
abstract byte[] |
getBinaryCopy(int columnIndex)
Get a copy of the specified column's binary data.
|
byte[] |
getBinaryCopy(String columnName)
Get a copy of the specified column's binary data.
|
abstract boolean |
getBoolean(int columnIndex)
Get the specified column's boolean
|
boolean |
getBoolean(String columnName)
Get the specified column's boolean
|
abstract byte |
getByte(int columnIndex)
Get the specified column's byte
|
byte |
getByte(String columnName)
Get the specified column's byte
|
Schema |
getColumnProjection()
Get the schema used for this scanner's column projection.
|
Type |
getColumnType(int columnIndex)
Get the type of a column in this result.
|
Type |
getColumnType(String columnName)
Get the type of a column in this result.
|
Date |
getDate(int columnIndex)
Get the specified column's Date.
|
Date |
getDate(String columnName)
Get the specified column's Date.
|
abstract BigDecimal |
getDecimal(int columnIndex)
Get the specified column's Decimal.
|
BigDecimal |
getDecimal(String columnName)
Get the specified column's Decimal.
|
abstract double |
getDouble(int columnIndex)
Get the specified column's double
|
double |
getDouble(String columnName)
Get the specified column's double
|
abstract float |
getFloat(int columnIndex)
Get the specified column's float
|
float |
getFloat(String columnName)
Get the specified column's float
|
abstract int |
getInt(int columnIndex)
Get the specified column's integer
|
int |
getInt(String columnName)
Get the specified column's integer
|
abstract long |
getLong(int columnIndex)
Get the specified column's long
If this is a UNIXTIME_MICROS column, the long value corresponds to a number of microseconds
since midnight, January 1, 1970 UTC.
|
long |
getLong(String columnName)
Get the specified column's long
If this is a UNIXTIME_MICROS column, the long value corresponds to a number of microseconds
since midnight, January 1, 1970 UTC.
|
Object |
getObject(int columnIndex)
Get the specified column's value as an Object.
|
Object |
getObject(String columnName)
Get the specified column's value as an Object.
|
Schema |
getSchema()
Get the schema associated with this result.
|
abstract short |
getShort(int columnIndex)
Get the specified column's short
|
short |
getShort(String columnName)
Get the specified column's short
|
String |
getString(int columnIndex)
Get the specified column's string.
|
String |
getString(String columnName)
Get the specified column's string.
|
abstract Timestamp |
getTimestamp(int columnIndex)
Get the specified column's Timestamp.
|
Timestamp |
getTimestamp(String columnName)
Get the specified column's Timestamp.
|
String |
getVarchar(int columnIndex)
Get the specified column's varchar.
|
String |
getVarchar(String columnName)
Get the specified column's varchar.
|
protected abstract String |
getVarLengthData(int columnIndex) |
abstract boolean |
isNull(int columnIndex)
Get if the specified column is NULL
|
boolean |
isNull(String columnName)
Get if the specified column is NULL
|
String |
rowToString()
Return the actual data from this row in a stringified key=value
form.
|
String |
toStringLongFormat() |
protected static final int INDEX_RESET_LOCATION
protected int index
protected final Schema schema
public final int getInt(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typepublic abstract int getInt(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final short getShort(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typepublic abstract short getShort(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final boolean getBoolean(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typepublic abstract boolean getBoolean(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final byte getByte(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typepublic abstract byte getByte(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final long getLong(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist or is nullpublic abstract long getLong(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is nullIndexOutOfBoundsException
- if the column doesn't existpublic final float getFloat(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typepublic abstract float getFloat(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final double getDouble(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typepublic abstract double getDouble(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final BigDecimal getDecimal(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist or is nullpublic abstract BigDecimal getDecimal(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is nullIndexOutOfBoundsException
- if the column doesn't existpublic final Timestamp getTimestamp(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist,
is null, is unset, or the type doesn't match the column's typepublic abstract Timestamp getTimestamp(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null, is unset,
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final Date getDate(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist,
is null, is unset, or the type doesn't match the column's typepublic final Date getDate(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null, is unset,
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final Schema getColumnProjection()
public final String getString(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typepublic final String getString(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existprotected abstract String getVarLengthData(int columnIndex)
public final String getVarchar(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final String getVarchar(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typepublic final byte[] getBinaryCopy(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic abstract byte[] getBinaryCopy(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final ByteBuffer getBinary(String columnName)
columnName
- name of the column to get data forIllegalArgumentException
- if the column doesn't exist, is null,
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic abstract ByteBuffer getBinary(int columnIndex)
columnIndex
- Column index in the schemaIllegalArgumentException
- if the column is null
or if the type doesn't match the column's typeIndexOutOfBoundsException
- if the column doesn't existpublic final boolean isNull(String columnName)
columnName
- name of the column in the schemaIndexOutOfBoundsException
- if the column doesn't existpublic abstract boolean isNull(int columnIndex)
columnIndex
- Column index in the schemaIndexOutOfBoundsException
- if the column doesn't existpublic final Object getObject(String columnName)
Type
:
Type.BOOL -> java.lang.Boolean
Type.INT8 -> java.lang.Byte
Type.INT16 -> java.lang.Short
Type.INT32 -> java.lang.Integer
Type.INT64 -> java.lang.Long
Type.UNIXTIME_MICROS -> java.sql.Timestamp
Type.FLOAT -> java.lang.Float
Type.DOUBLE -> java.lang.Double
Type.VARCHAR -> java.lang.String
Type.STRING -> java.lang.String
Type.BINARY -> byte[]
Type.DECIMAL -> java.math.BigDecimalcolumnName
- name of the column in the schemaIndexOutOfBoundsException
- if the column doesn't existpublic final Object getObject(int columnIndex)
Type
:
Type.BOOL -> java.lang.Boolean
Type.INT8 -> java.lang.Byte
Type.INT16 -> java.lang.Short
Type.INT32 -> java.lang.Integer
Type.INT64 -> java.lang.Long
Type.UNIXTIME_MICROS -> java.sql.Timestamp
Type.FLOAT -> java.lang.Float
Type.DOUBLE -> java.lang.Double
Type.VARCHAR -> java.lang.String
Type.STRING -> java.lang.String
Type.BINARY -> byte[]
Type.DECIMAL -> java.math.BigDecimal
Type.Date -> java.sql.DatecolumnIndex
- Column index in the schemaIndexOutOfBoundsException
- if the column doesn't existpublic final Type getColumnType(String columnName)
columnName
- name of the columnpublic final Type getColumnType(int columnIndex)
columnIndex
- column index in the schemaIndexOutOfBoundsException
- if the column doesn't existpublic final Schema getSchema()
protected final void checkValidColumn(int columnIndex)
IndexOutOfBoundsException
- if the column doesn't existprotected final void checkNull(int columnIndex)
IllegalArgumentException
- if the column is nullprotected final void checkType(int columnIndex, Type... types)
public String rowToString()
public String toStringLongFormat()