Package com.clickhouse.client
Interface ClickHouseRecord
-
- All Superinterfaces:
Iterable<ClickHouseValue>,Serializable
- All Known Implementing Classes:
ClickHouseSimpleRecord
public interface ClickHouseRecord extends Iterable<ClickHouseValue>, Serializable
This defines a record returned from ClickHouse server. Usually it's a row but sometimes it could a (nested) column, a (semi-)structured object, or even the whole data set.
-
-
Field Summary
Fields Modifier and Type Field Description static ClickHouseRecordEMPTYEmpty record.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ClickHouseRecordcopy()Creates a new record by copying values from current one.ClickHouseValuegetValue(int index)Gets deserialized value wrapped in an object using column index.ClickHouseValuegetValue(String name)Gets deserialized value wrapped in an object using case-insensitive column name, which usually is slower thangetValue(int).default Iterator<ClickHouseValue>iterator()intsize()Gets size of the record.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
EMPTY
static final ClickHouseRecord EMPTY
Empty record.
-
-
Method Detail
-
copy
ClickHouseRecord copy()
Creates a new record by copying values from current one.- Returns:
- a new record
-
getValue
ClickHouseValue getValue(int index)
Gets deserialized value wrapped in an object using column index. Please avoid to cache the wrapper object, as it's reused among records for memory efficiency whenClickHouseConfig.isReuseValueWrapper()returnstrue, which is the default value. So instead ofmap.put("my_value", record.getValue(0)), try something likemap.put("my_value", record.getValue(0).asString()).- Parameters:
index- zero-based index of the column- Returns:
- non-null wrapped value
-
getValue
ClickHouseValue getValue(String name)
Gets deserialized value wrapped in an object using case-insensitive column name, which usually is slower thangetValue(int). Please avoid to cache the wrapper object, as it's reused among records for memory efficiency whenClickHouseConfig.isReuseValueWrapper()returnstrue, which is the default value. So instead ofmap.put("my_value", record.getValue("my_column")), try something likemap.put("my_value", record.getValue("my_column").asString()).- Parameters:
name- case-insensitive name of the column- Returns:
- non-null wrapped value
-
iterator
default Iterator<ClickHouseValue> iterator()
- Specified by:
iteratorin interfaceIterable<ClickHouseValue>
-
size
int size()
Gets size of the record.- Returns:
- size of the record
-
-