@InterfaceAudience.Public @InterfaceStability.Evolving public class PartialRow extends Object
Constructor and Description |
---|
PartialRow(Schema schema)
This is not a stable API, prefer using
Schema.newPartialRow()
to create a new partial row. |
Modifier and Type | Method and Description |
---|---|
void |
addBinary(int columnIndex,
byte[] val)
Add binary data with the specified value.
|
void |
addBinary(String columnName,
byte[] val)
Add binary data with the specified value.
|
void |
addBoolean(int columnIndex,
boolean val)
Add a boolean for the specified column.
|
void |
addBoolean(String columnName,
boolean val)
Add a boolean for the specified column.
|
void |
addByte(int columnIndex,
byte val)
Add a byte for the specified column.
|
void |
addByte(String columnName,
byte val)
Add a byte for the specified column.
|
void |
addDouble(int columnIndex,
double val)
Add an double for the specified column.
|
void |
addDouble(String columnName,
double val)
Add an double for the specified column.
|
void |
addFloat(int columnIndex,
float val)
Add an float for the specified column.
|
void |
addFloat(String columnName,
float val)
Add an float for the specified column.
|
void |
addInt(int columnIndex,
int val)
Add an int for the specified column.
|
void |
addInt(String columnName,
int val)
Add an int for the specified column.
|
void |
addLong(int columnIndex,
long val)
Add an long for the specified column.
|
void |
addLong(String columnName,
long val)
Add an long for the specified column.
|
void |
addShort(int columnIndex,
short val)
Add a short for the specified column.
|
void |
addShort(String columnName,
short val)
Add a short for the specified column.
|
void |
addString(int columnIndex,
String val)
Add a String for the specified column.
|
void |
addString(String columnName,
String val)
Add a String for the specified column.
|
void |
addStringUtf8(int columnIndex,
byte[] val)
Add a String for the specified value, encoded as UTF8.
|
void |
addStringUtf8(String columnName,
byte[] val)
Add a String for the specified value, encoded as UTF8.
|
byte[] |
encodePrimaryKey()
Returns the encoded primary key of the row.
|
void |
reset()
Removes all column values from the row.
|
void |
setNull(int columnIndex)
Set the specified column to null
|
void |
setNull(String columnName)
Set the specified column to null
|
public PartialRow(Schema schema)
Schema.newPartialRow()
to create a new partial row.schema
- the schema to use for this rowpublic void addBoolean(int columnIndex, boolean val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addBoolean(String columnName, boolean val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addByte(int columnIndex, byte val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addByte(String columnName, byte val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addShort(int columnIndex, short val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addShort(String columnName, short val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addInt(int columnIndex, int val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addInt(String columnName, int val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addLong(int columnIndex, long val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addLong(String columnName, long val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addFloat(int columnIndex, float val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addFloat(String columnName, float val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addDouble(int columnIndex, double val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addDouble(String columnName, double val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addString(int columnIndex, String val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addString(String columnName, String val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addStringUtf8(int columnIndex, byte[] val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addStringUtf8(String columnName, byte[] val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't exist or the value doesn't match
the column's typepublic void addBinary(int columnIndex, byte[] val)
columnIndex
- the column's index in the schemaval
- value to addIllegalArgumentException
- if the column doesn't existpublic void addBinary(String columnName, byte[] val)
columnName
- Name of the columnval
- value to addIllegalArgumentException
- if the column doesn't existpublic void setNull(int columnIndex)
columnIndex
- the column's index in the schemaIllegalArgumentException
- if the column doesn't exist or cannot be set to nullpublic void setNull(String columnName)
columnName
- Name of the columnIllegalArgumentException
- if the column doesn't exist or cannot be set to nullpublic void reset()
public byte[] encodePrimaryKey()
Copyright © 2015. All rights reserved.