Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ public static void writeDynamicTypeTag(OutputStream stream, ClickHouseColumn typ
}
}

/**
DO NOT USE - part of internal API that will be changed
*/
public static void serializeArrayData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException {
if (value == null) {
writeVarInt(stream, 0);
Expand All @@ -437,7 +440,10 @@ public static void serializeArrayData(OutputStream stream, Object value, ClickHo
}
}

private static void serializeTupleData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException {
/**
DO NOT USE - part of internal API that will be changed
*/
public static void serializeTupleData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Class will be redesigned and API will be changed.
Even it is in internal package please put a short javadoc for each exposed method

/** 
   DO NOT USE - part of internal API that will be changed
*/

//Serialize the tuple to the stream
//The tuple is a list of values
if (value instanceof List) {
Expand All @@ -455,7 +461,10 @@ private static void serializeTupleData(OutputStream stream, Object value, ClickH
}
}

private static void serializeMapData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException {
/**
DO NOT USE - part of internal API that will be changed
*/
public static void serializeMapData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException {
//Serialize the map to the stream
//The map is a list of key-value pairs
Map<?, ?> map = (Map<?, ?>) value;
Expand Down Expand Up @@ -596,7 +605,7 @@ private static void serializePrimitiveData(OutputStream stream, Object value, Cl
}
}

private static void serializeInterval(OutputStream stream, ClickHouseColumn column, Object value) throws IOException {
public static void serializeInterval(OutputStream stream, ClickHouseColumn column, Object value) throws IOException {
long v;

if (value instanceof Duration) {
Expand Down Expand Up @@ -666,7 +675,7 @@ private static void serializeTime64(OutputStream stream, Object value) throws IO
}
}

private static void serializeEnumData(OutputStream stream, ClickHouseColumn column, Object value) throws IOException {
public static void serializeEnumData(OutputStream stream, ClickHouseColumn column, Object value) throws IOException {
int enumValue = -1;
if (value instanceof String) {
enumValue = column.getEnumConstants().value((String) value);
Expand All @@ -687,15 +696,15 @@ private static void serializeEnumData(OutputStream stream, ClickHouseColumn colu
}
}

private static void serializeJSON(OutputStream stream, Object value) throws IOException {
public static void serializeJSON(OutputStream stream, Object value) throws IOException {
if (value instanceof String) {
BinaryStreamUtils.writeString(stream, (String)value);
} else {
throw new UnsupportedOperationException("Serialization of Java object to JSON is not supported yet.");
}
}

private static void serializerVariant(OutputStream out, ClickHouseColumn column, Object value) throws IOException {
public static void serializerVariant(OutputStream out, ClickHouseColumn column, Object value) throws IOException {
int typeOrdNum = column.getVariantOrdNum(value);
if (typeOrdNum != -1) {
BinaryStreamUtils.writeUnsignedInt8(out, typeOrdNum);
Expand All @@ -710,7 +719,7 @@ private static void serializerVariant(OutputStream out, ClickHouseColumn column,
private static final ClickHouseColumn GEO_POLYGON_ARRAY = ClickHouseColumn.parse("geopolygin Array(Array(Tuple(Float64, Float64)))").get(0);
private static final ClickHouseColumn GEO_MULTI_POLYGON_ARRAY = ClickHouseColumn.parse("geomultipolygin Array(Array(Array(Tuple(Float64, Float64))))").get(0);

private static void serializeAggregateFunction(OutputStream stream, Object value, ClickHouseColumn column) throws IOException {
public static void serializeAggregateFunction(OutputStream stream, Object value, ClickHouseColumn column) throws IOException {
if (column.getAggregateFunction() == ClickHouseAggregateFunction.groupBitmap) {
if (value == null) {
throw new IllegalArgumentException("Cannot serialize null value for aggregate function: " + column.getAggregateFunction());
Expand Down
Loading