diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/AbstractColumn.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/AbstractColumn.java index 2580d73..355aea3 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/AbstractColumn.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/AbstractColumn.java @@ -70,10 +70,18 @@ public ColumnWriterBuffer getColumnWriterBuffer() { } @Override - public void flushToSerializer(BinarySerializer serializer, boolean now) throws IOException, SQLException { - SerializeBulkPrefix(serializer); - SerializeBulk(serializer, now); - SerializeBulkSuffix(serializer); + public void SerializeBulkPrefix(BinarySerializer serializer) throws IOException, SQLException { + + } + + @Override + public void SerializeBulk(BinarySerializer serializer, Boolean now) throws IOException, SQLException { + + } + + @Override + public void SerializeBulkSuffix(BinarySerializer serializer) throws IOException, SQLException { + } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/Block.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/Block.java index 2b9e97c..c83337d 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/Block.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/Block.java @@ -44,7 +44,9 @@ public static Block readFrom(BinaryDeserializer deserializer, String type = deserializer.readUTF8StringBinary(); IDataType dataType = DataTypeFactory.get(type, serverContext); - Object[] arr = dataType.deserializeBinaryFromStream(rowCnt, deserializer); + dataType.deserializeBinaryPrefix(rowCnt, deserializer); + Object[] arr = dataType.deserializeBinaryBulk(rowCnt, deserializer); + dataType.deserializeBinarySuffix(rowCnt, deserializer); columns[i] = ColumnFactory.createColumn(name, dataType, arr); } @@ -126,7 +128,9 @@ public void writeTo(BinarySerializer serializer) throws IOException, SQLExceptio for (IColumn column : columns) { serializer.writeUTF8StringBinary(column.name()); serializer.writeUTF8StringBinary(column.type().name()); - column.flushToSerializer(serializer, true); + column.SerializeBulkPrefix(serializer); + column.SerializeBulk(serializer, true); + column.SerializeBulkSuffix(serializer); } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/Column.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/Column.java index f502ee9..010576c 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/Column.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/Column.java @@ -32,18 +32,7 @@ public void write(Object object) throws IOException, SQLException { } @Override - public void flushToSerializer(BinarySerializer serializer, boolean now) throws IOException, SQLException { - super.flushToSerializer(serializer, now); - } - - @Override - public void SerializeBulkPrefix(BinarySerializer serializer) { } - - @Override - public void SerializeBulkSuffix(BinarySerializer serializer) { } - - @Override - public void SerializeBulk(BinarySerializer serializer, boolean now) throws IOException, SQLException { + public void SerializeBulk(BinarySerializer serializer, Boolean now) throws IOException, SQLException { if (now) { buffer.writeTo(serializer); } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnArray.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnArray.java index ee894ae..c7d5826 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnArray.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnArray.java @@ -45,17 +45,11 @@ public void write(Object object) throws IOException, SQLException { } @Override - public void flushToSerializer(BinarySerializer serializer, boolean immediate) throws SQLException, IOException { - super.flushToSerializer(serializer, immediate); - } - - @Override - public void SerializeBulk(BinarySerializer serializer, boolean immediate) throws SQLException, IOException { - + public void SerializeBulk(BinarySerializer serializer, Boolean now) throws IOException, SQLException { flushOffsets(serializer); data.SerializeBulk(serializer, false); - if (immediate) { + if (now) { buffer.writeTo(serializer); } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnLowCardinality.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnLowCardinality.java index 6b82320..bf3d22e 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnLowCardinality.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnLowCardinality.java @@ -70,9 +70,8 @@ public void write(Object object) throws IOException, SQLException { } @Override - public void SerializeBulk(BinarySerializer serializer, boolean immediate) throws IOException, SQLException { - /// The data layout: [version][index_type][dictionary][indexes] - // serializer.writeLong(version); + public void SerializeBulk(BinarySerializer serializer, Boolean now) throws IOException, SQLException { + /// The data layout: [index_type][dictionary][indexes] serializer.writeLong(IndexType.UInt64.getValue() | IndexType.HasAdditionalKeysBit.getValue()); serializer.writeLong(dict.size()); for (int i = 0; i < dict.size(); i++) { @@ -99,18 +98,7 @@ public void clear() { @Override public void SerializeBulkPrefix(BinarySerializer serializer) throws IOException, SQLException { - /// The data layout: [version][index_type][dictionary][indexes] serializer.writeLong(version); } - @Override - public void SerializeBulkSuffix(BinarySerializer serializer) { - } - - @Override - public void flushToSerializer(BinarySerializer serializer, boolean immediate) throws SQLException, IOException { - super.flushToSerializer(serializer, immediate); - } - - } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnMap.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnMap.java index bf78397..45aa996 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnMap.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnMap.java @@ -57,7 +57,7 @@ public void write(Object object) throws IOException, SQLException { } @Override - public void SerializeBulk(BinarySerializer serializer, boolean now) throws IOException, SQLException { + public void SerializeBulk(BinarySerializer serializer, Boolean now) throws IOException, SQLException { flushOffsets(serializer); @@ -100,12 +100,5 @@ public void SerializeBulkPrefix(BinarySerializer serializer) throws SQLException } } - @Override - public void SerializeBulkSuffix(BinarySerializer serializer) { - } - @Override - public void flushToSerializer(BinarySerializer serializer, boolean immediate) throws SQLException, IOException { - super.flushToSerializer(serializer, immediate); - } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnNullable.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnNullable.java index 65b7411..47c786f 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnNullable.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnNullable.java @@ -47,12 +47,12 @@ public void write(@Nullable Object object) throws IOException, SQLException { } @Override - public void SerializeBulk(BinarySerializer serializer, boolean immediate) throws IOException { + public void SerializeBulk(BinarySerializer serializer, Boolean now) throws IOException, SQLException { for (byte sign : nullableSign) { serializer.writeByte(sign); } - if (immediate) + if (now) buffer.writeTo(serializer); } @@ -62,18 +62,4 @@ public void setColumnWriterBuffer(ColumnWriterBuffer buffer) { data.setColumnWriterBuffer(buffer); } - @Override - public void SerializeBulkPrefix(BinarySerializer serializer) { - - } - - @Override - public void SerializeBulkSuffix(BinarySerializer serializer) { - - } - - @Override - public void flushToSerializer(BinarySerializer serializer, boolean immediate) throws SQLException, IOException { - super.flushToSerializer(serializer, immediate); - } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnTuple.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnTuple.java index 22e0ad8..5e0afb7 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnTuple.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/ColumnTuple.java @@ -45,12 +45,7 @@ public void write(Object object) throws IOException, SQLException { } @Override - public void SerializeBulk(BinarySerializer serializer, boolean now) throws SQLException, IOException { - // if (isExported()) { - // serializer.writeUTF8StringBinary(name); - // serializer.writeUTF8StringBinary(type.name()); - // } - + public void SerializeBulk(BinarySerializer serializer, Boolean now) throws IOException, SQLException { // we should to flush all the nested data to serializer // because they are using separate buffers. for (IColumn data : columnDataArray) { @@ -82,13 +77,4 @@ public void SerializeBulkPrefix(BinarySerializer serializer) throws SQLException } } - @Override - public void SerializeBulkSuffix(BinarySerializer serializer) { - - } - - @Override - public void flushToSerializer(BinarySerializer serializer, boolean immediate) throws SQLException, IOException { - super.flushToSerializer(serializer, immediate); - } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/IColumn.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/IColumn.java index 5a873f3..ad37202 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/IColumn.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/IColumn.java @@ -31,26 +31,23 @@ public interface IColumn { void write(Object object) throws IOException, SQLException; + void clear(); - void SerializeBulkPrefix(BinarySerializer serializer) throws IOException, SQLException; + void setColumnWriterBuffer(ColumnWriterBuffer buffer); + ColumnWriterBuffer getColumnWriterBuffer(); /** * Flush to socket output stream * * @param serializer is serializer wrapper of tcp socket * @param now means we should flush all the buffer to serializer now */ - void flushToSerializer(BinarySerializer serializer, boolean now) throws IOException, SQLException; - - void SerializeBulkSuffix(BinarySerializer serializer) throws IOException, SQLException; - - void SerializeBulk(BinarySerializer serializer, boolean now) throws IOException, SQLException; - - void clear(); + void SerializeBulkPrefix(BinarySerializer serializer) throws IOException, SQLException; - void setColumnWriterBuffer(ColumnWriterBuffer buffer); + void SerializeBulk(BinarySerializer serializer, Boolean now) throws IOException, SQLException; - ColumnWriterBuffer getColumnWriterBuffer(); + void SerializeBulkSuffix(BinarySerializer serializer) throws IOException, SQLException; } + diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/IDataType.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/IDataType.java index 7e4bc78..bf36c58 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/IDataType.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/IDataType.java @@ -84,14 +84,12 @@ default Object[] deserializeBinaryBulk(int rows, BinaryDeserializer deserializer return data; } - void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException; + default void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { - void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException; - - default Object[] deserializeBinaryFromStream(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { - deserializeBinaryPrefix(rows, deserializer); - Object[] arr = deserializeBinaryBulk(rows, deserializer); - deserializeBinarySuffix(rows, deserializer); - return arr; } + + default void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { + + } + } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeBool.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeBool.java index 4344732..636c614 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeBool.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeBool.java @@ -68,9 +68,4 @@ public boolean isSigned() { return true; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeDate.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeDate.java index 7ea560c..9aa48a4 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeDate.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeDate.java @@ -98,9 +98,4 @@ public LocalDate deserializeText(SQLLexer lexer) throws SQLException { return LocalDate.of(year, month, day); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeDate32.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeDate32.java index 8567cb1..f2c626e 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeDate32.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeDate32.java @@ -99,9 +99,4 @@ public LocalDate deserializeText(SQLLexer lexer) throws SQLException { return LocalDate.of(year, month, day); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeFloat32.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeFloat32.java index 4852ae6..c46cd96 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeFloat32.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeFloat32.java @@ -80,9 +80,4 @@ public boolean isSigned() { return true; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeFloat64.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeFloat64.java index 8ec24ed..a6f09c4 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeFloat64.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeFloat64.java @@ -80,9 +80,4 @@ public boolean isSigned() { return true; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeIPv4.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeIPv4.java index 242a020..cc9c3d3 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeIPv4.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeIPv4.java @@ -75,9 +75,4 @@ public Long deserializeText(SQLLexer lexer) throws SQLException { return lexer.numberLiteral().longValue() & 0xffffffffL; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeIPv6.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeIPv6.java index fefbb5b..0841331 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeIPv6.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeIPv6.java @@ -88,9 +88,4 @@ private static String convertIPv6ToHexadecimalString(String ipv6) { return ipv6.replace(":", ""); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt128.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt128.java index 9d9743c..33a4668 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt128.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt128.java @@ -73,10 +73,5 @@ public BigInteger deserializeText(SQLLexer lexer) throws SQLException { return new BigInteger(Integer128, 10); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt16.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt16.java index 449a9b8..ffcd9a5 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt16.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt16.java @@ -69,9 +69,4 @@ public boolean isSigned() { return true; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt256.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt256.java index cca0c95..f471fac 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt256.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt256.java @@ -73,9 +73,4 @@ public BigInteger deserializeText(SQLLexer lexer) throws SQLException { return new BigInteger(Integer256, 10); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt32.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt32.java index 21b3541..4178575 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt32.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt32.java @@ -68,9 +68,4 @@ public boolean isSigned() { return true; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt64.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt64.java index de975e3..18af489 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt64.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt64.java @@ -68,9 +68,4 @@ public boolean isSigned() { return true; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt8.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt8.java index e7bf398..ba027d6 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt8.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeInt8.java @@ -68,9 +68,4 @@ public boolean isSigned() { return true; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt128.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt128.java index 79c3af3..1b3f0c2 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt128.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt128.java @@ -70,13 +70,4 @@ public BigInteger deserializeText(SQLLexer lexer) throws SQLException { return new BigInteger(Uinteger128, 10); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { - - } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { - - } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt16.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt16.java index 75df36e..a105e4f 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt16.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt16.java @@ -59,9 +59,4 @@ public Integer deserializeText(SQLLexer lexer) throws SQLException { return lexer.numberLiteral().intValue(); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt256.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt256.java index 03f71ed..2503464 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt256.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt256.java @@ -70,13 +70,4 @@ public BigInteger deserializeText(SQLLexer lexer) throws SQLException { return new BigInteger(Uinteger256, 10); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { - - } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { - - } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt32.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt32.java index 393fea2..055f053 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt32.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt32.java @@ -59,9 +59,4 @@ public Long deserializeText(SQLLexer lexer) throws SQLException { return lexer.numberLiteral().longValue(); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt64.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt64.java index 243736f..a18ea2e 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt64.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt64.java @@ -69,9 +69,4 @@ public BigInteger deserializeText(SQLLexer lexer) throws SQLException { return BigInteger.valueOf(lexer.numberLiteral().longValue()); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt8.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt8.java index cff9bc8..fe7b775 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt8.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUInt8.java @@ -59,9 +59,4 @@ public Short deserializeText(SQLLexer lexer) throws SQLException { return lexer.numberLiteral().shortValue(); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUUID.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUUID.java index 8b0ae67..d5d0a71 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUUID.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/DataTypeUUID.java @@ -77,13 +77,4 @@ public UUID deserializeBinary(BinaryDeserializer deserializer) throws SQLExcepti return new UUID(deserializer.readLong(), deserializer.readLong()); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { - - } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { - - } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeArray.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeArray.java index 7b07b55..22fe82e 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeArray.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeArray.java @@ -154,8 +154,12 @@ public IDataType getElemDataType() { } @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } + public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { + getElemDataType().deserializeBinaryPrefix(rows, deserializer); + } @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } + public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { + getElemDataType().deserializeBinarySuffix(rows, deserializer); + } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDateTime.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDateTime.java index 6175d95..620fb0e 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDateTime.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDateTime.java @@ -120,10 +120,4 @@ public ZonedDateTime deserializeBinary(BinaryDeserializer deserializer) throws S public String[] getAliases() { return new String[]{"TIMESTAMP"}; } - - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDateTime64.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDateTime64.java index 893192b..9c45c05 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDateTime64.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDateTime64.java @@ -152,9 +152,4 @@ public ZonedDateTime deserializeBinary(BinaryDeserializer deserializer) throws I return DateTimeUtil.toZonedDateTime(epochSeconds, nanos, tz); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDecimal.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDecimal.java index 518df36..5bd8646 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDecimal.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeDecimal.java @@ -196,9 +196,4 @@ public boolean isSigned() { return true; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeEnum16.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeEnum16.java index f5f343f..22daa63 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeEnum16.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeEnum16.java @@ -133,9 +133,4 @@ public String deserializeBinary(BinaryDeserializer deserializer) throws SQLExcep throw new SQLException(""); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeEnum8.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeEnum8.java index bb5d646..031fe04 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeEnum8.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeEnum8.java @@ -130,9 +130,4 @@ public String deserializeBinary(BinaryDeserializer deserializer) throws SQLExcep throw new SQLException(""); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeFixedString.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeFixedString.java index 84221e4..9c2e562 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeFixedString.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeFixedString.java @@ -126,9 +126,4 @@ public String[] getAliases() { return new String[]{"BINARY"}; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeLowCardinality.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeLowCardinality.java index d5dd4f2..94f8156 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeLowCardinality.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeLowCardinality.java @@ -191,8 +191,5 @@ public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) t } } } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeMap.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeMap.java index 49d67e4..f3cc1b3 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeMap.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeMap.java @@ -180,5 +180,8 @@ public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) t } @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } + public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { + getNestedTypes()[0].deserializeBinarySuffix(rows, deserializer); + getNestedTypes()[1].deserializeBinarySuffix(rows, deserializer); + } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeNothing.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeNothing.java index d9f47e2..b405b06 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeNothing.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeNothing.java @@ -84,9 +84,4 @@ public Object deserializeText(SQLLexer lexer) throws SQLException { throw new InvalidOperationException("Nothing datatype can't deserializeText"); } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeNullable.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeNullable.java index 6a5c95c..78c05de 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeNullable.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeNullable.java @@ -149,10 +149,4 @@ public Object[] deserializeBinaryBulk(int rows, BinaryDeserializer deserializer) public boolean isSigned() { return nestedDataType.isSigned(); } - - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeString.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeString.java index 1d5710b..652bff0 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeString.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeString.java @@ -109,9 +109,4 @@ public String[] getAliases() { "BLOB"}; } - @Override - public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } - - @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } } diff --git a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeTuple.java b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeTuple.java index 66d6c61..219fe7c 100644 --- a/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeTuple.java +++ b/timeplus-native-jdbc/src/main/java/com/timeplus/data/type/complex/DataTypeTuple.java @@ -174,5 +174,9 @@ public void deserializeBinaryPrefix(int rows, BinaryDeserializer deserializer) t } @Override - public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { } + public void deserializeBinarySuffix(int rows, BinaryDeserializer deserializer) throws SQLException, IOException { + for (int i = 0; i < getNestedTypes().length; i++) { + getNestedTypes()[i].deserializeBinarySuffix(rows, deserializer); + } + } }