Class SerializerUtils
java.lang.Object
com.clickhouse.client.api.data_formats.internal.SerializerUtils
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic POJOFieldDeserializercompilePOJOSetter(Method setterMethod, ClickHouseColumn column) static List<?>convertArrayValueToList(Object value) static booleanconvertToBoolean(Object value) static IntegerconvertToInteger(Object value) static LongconvertToLong(Object value) static StringconvertToString(Object value) static booleannumberToBoolean(Number value) parseEnumList(String value, Class<T> enumType) static voidserializeAggregateFunction(OutputStream stream, Object value, ClickHouseColumn column) static voidserializeArrayData(OutputStream stream, Object value, ClickHouseColumn column) DO NOT USE - part of internal API that will be changedstatic voidserializeData(OutputStream stream, Object value, ClickHouseColumn column) static voidserializeEnumData(OutputStream stream, ClickHouseColumn column, Object value) static voidserializeInterval(OutputStream stream, ClickHouseColumn column, Object value) static voidserializeJSON(OutputStream stream, Object value) static voidserializeMapData(OutputStream stream, Object value, ClickHouseColumn column) DO NOT USE - part of internal API that will be changedstatic voidserializerGeometry(OutputStream out, ClickHouseColumn column, Object value) static voidserializerVariant(OutputStream out, ClickHouseColumn column, Object value) static voidserializeTupleData(OutputStream stream, Object value, ClickHouseColumn column) DO NOT USE - part of internal API that will be changedstatic byte[]stringValueToByteArray(Object value) Used from the bytecode generated bycompilePOJOSetter(Method, ClickHouseColumn).static StringstringValueToString(Object value) Used from the bytecode generated bycompilePOJOSetter(Method, ClickHouseColumn).static ClickHouseColumnstatic voidwriteBoolean(OutputStream output, boolean value) static voidwriteDate(OutputStream output, Object value, ZoneId targetTz) static voidwriteDate32(OutputStream output, Object value, ZoneId targetTz) static voidwriteDateTime(OutputStream output, Object value, ZoneId targetTz) static voidwriteDateTime32(OutputStream output, Object value, ZoneId targetTz) static voidwriteDateTime64(OutputStream output, Object value, int scale, ZoneId targetTz) static voidwriteDynamicTypeTag(OutputStream stream, ClickHouseColumn typeColumn) static voidwriteFixedStringBytes(OutputStream stream, byte[] value, int length) Writes raw bytes as a ClickHouseFixedString(length)value.static voidwriteNonNull(OutputStream output) static voidwriteNull(OutputStream output) static voidwriteVarInt(OutputStream output, long value)
-
Constructor Details
-
SerializerUtils
public SerializerUtils()
-
-
Method Details
-
serializeData
public static void serializeData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException - Throws:
IOException
-
valueToColumnForDynamicType
-
writeDynamicTypeTag
public static void writeDynamicTypeTag(OutputStream stream, ClickHouseColumn typeColumn) throws IOException - Throws:
IOException
-
serializeArrayData
public static void serializeArrayData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException DO NOT USE - part of internal API that will be changed- Throws:
IOException
-
serializeTupleData
public static void serializeTupleData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException DO NOT USE - part of internal API that will be changed- Throws:
IOException
-
serializeMapData
public static void serializeMapData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException DO NOT USE - part of internal API that will be changed- Throws:
IOException
-
serializeInterval
public static void serializeInterval(OutputStream stream, ClickHouseColumn column, Object value) throws IOException - Throws:
IOException
-
serializeEnumData
public static void serializeEnumData(OutputStream stream, ClickHouseColumn column, Object value) throws IOException - Throws:
IOException
-
serializeJSON
- Throws:
IOException
-
serializerVariant
public static void serializerVariant(OutputStream out, ClickHouseColumn column, Object value) throws IOException - Throws:
IOException
-
serializerGeometry
public static void serializerGeometry(OutputStream out, ClickHouseColumn column, Object value) throws IOException - Throws:
IOException
-
serializeAggregateFunction
public static void serializeAggregateFunction(OutputStream stream, Object value, ClickHouseColumn column) throws IOException - Throws:
IOException
-
convertToInteger
-
convertToLong
-
convertToString
-
stringValueToString
Used from the bytecode generated bycompilePOJOSetter(Method, ClickHouseColumn). Does all needed conversions so have to accept Object instead of specific value type.- Parameters:
value- value returned byBinaryStreamReader.readValue- Returns:
- the decoded string, or
null
-
stringValueToByteArray
Used from the bytecode generated bycompilePOJOSetter(Method, ClickHouseColumn). Does all needed conversions so have to accept Object instead of specific value type.- Parameters:
value- value returned byBinaryStreamReader.readValue- Returns:
- the raw bytes, or
null
-
writeFixedStringBytes
public static void writeFixedStringBytes(OutputStream stream, byte[] value, int length) throws IOException Writes raw bytes as a ClickHouseFixedString(length)value. The bytes are written as-is and right-padded with zero bytes when shorter thanlength.- Parameters:
stream- output streamvalue- raw byteslength- fixed string length- Throws:
IOException- when failed to write to the stream
-
parseEnumList
-
numberToBoolean
-
convertToBoolean
-
convertArrayValueToList
-
compilePOJOSetter
- Parameters:
setterMethod-column-- Returns:
- See Also:
-
ClickHouseDataType.toPrimitiveType(Class)BinaryStreamReader.isReadToPrimitive(ClickHouseDataType)stringValueToString(Object)stringValueToByteArray(Object)binaryReaderMethodForType(MethodVisitor, Class, ClickHouseDataType)intToOpcode(Class)longToOpcode(Class)floatToOpcode(Class)doubleToOpcode(Class)BinaryStreamReader.readValue(ClickHouseColumn, Class)BinaryStreamReader.readByte()BinaryStreamReader.readUnsignedByte()BinaryStreamReader.readShortLE()BinaryStreamReader.readUnsignedShortLE()BinaryStreamReader.readIntLE()BinaryStreamReader.readUnsignedIntLE()BinaryStreamReader.readLongLE()BinaryStreamReader.readFloatLE()BinaryStreamReader.readDoubleLE()Arrays.asList(Object[])
-
writeVarInt
- Throws:
IOException
-
writeNull
- Throws:
IOException
-
writeNonNull
- Throws:
IOException
-
writeBoolean
- Throws:
IOException
-
writeDate
- Throws:
IOException
-
writeDate32
public static void writeDate32(OutputStream output, Object value, ZoneId targetTz) throws IOException - Throws:
IOException
-
writeDateTime32
public static void writeDateTime32(OutputStream output, Object value, ZoneId targetTz) throws IOException - Throws:
IOException
-
writeDateTime
public static void writeDateTime(OutputStream output, Object value, ZoneId targetTz) throws IOException - Throws:
IOException
-
writeDateTime64
public static void writeDateTime64(OutputStream output, Object value, int scale, ZoneId targetTz) throws IOException - Throws:
IOException
-