Package com.clickhouse.data
Class ClickHouseSimpleRecord
java.lang.Object
com.clickhouse.data.ClickHouseSimpleRecord
- All Implemented Interfaces:
ClickHouseRecord,Serializable,Iterable<ClickHouseValue>
Default implementation of
ClickHouseRecord,
which is simply a combination of list of columns and array of values.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClickHouseSimpleRecord(List<ClickHouseColumn> columns, ClickHouseValue[] values) -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a new record by copying values from current one.protected List<ClickHouseColumn>getValue(int index) Gets deserialized value wrapped in an object using column index.Gets deserialized value wrapped in an object using case-insensitive column name, which usually is slower thanClickHouseRecord.getValue(int).protected ClickHouseValue[]static ClickHouseRecordof(List<ClickHouseColumn> columns, ClickHouseValue[] values) Creates a record object to wrap given values.intsize()Gets size of the record.protected voidupdate(ClickHouseValue[] values) protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.clickhouse.data.ClickHouseRecord
iteratorMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ClickHouseSimpleRecord
-
-
Method Details
-
of
Creates a record object to wrap given values.- Parameters:
columns- non-null list of columnsvalues- non-null array of values- Returns:
- record
-
getColumns
-
getValues
-
update
-
update
-
copy
Description copied from interface:ClickHouseRecordCreates a new record by copying values from current one.- Specified by:
copyin interfaceClickHouseRecord- Returns:
- a new record
-
getValue
Description copied from interface:ClickHouseRecordGets 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 whenClickHouseDataConfig.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()).- Specified by:
getValuein interfaceClickHouseRecord- Parameters:
index- zero-based index of the column- Returns:
- non-null wrapped value
-
getValue
Description copied from interface:ClickHouseRecordGets deserialized value wrapped in an object using case-insensitive column name, which usually is slower thanClickHouseRecord.getValue(int). Please avoid to cache the wrapper object, as it's reused among records for memory efficiency whenClickHouseDataConfig.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()).- Specified by:
getValuein interfaceClickHouseRecord- Parameters:
name- case-insensitive name of the column- Returns:
- non-null wrapped value
-
size
public int size()Description copied from interface:ClickHouseRecordGets size of the record.- Specified by:
sizein interfaceClickHouseRecord- Returns:
- size of the record
-