1212import java .math .BigInteger ;
1313import java .net .Inet4Address ;
1414import java .net .Inet6Address ;
15+ import java .time .ZoneId ;
1516import java .time .ZonedDateTime ;
1617
1718/**
1819 * This class is intended to be used for very precise data serializations.
1920 * It is an auxiliary class to handle only low level write operations.
21+ * <p>
22+ * Experimental API
2023 */
2124public class RowBinaryFormatSerializer {
2225
@@ -127,19 +130,19 @@ public void writeFixedString(String value, int len) throws IOException {
127130 }
128131
129132 public void writeDate (ZonedDateTime value ) throws IOException {
130-
133+ SerializerUtils . writeDate ( out , value , ZoneId . of ( "UTC" ));
131134 }
132135
133- public void writeDate32 (ZonedDateTime value ) throws IOException {
134-
136+ public void writeDate32 (ZonedDateTime value , ZoneId targetTz ) throws IOException {
137+ SerializerUtils . writeDate32 ( out , value , targetTz );
135138 }
136139
137- public void writeDateTime (ZonedDateTime value ) throws IOException {
138-
140+ public void writeDateTime (ZonedDateTime value , ZoneId targetTz ) throws IOException {
141+ SerializerUtils . writeDateTime ( out , value , targetTz );
139142 }
140143
141- public void writeDateTime64 (ZonedDateTime value ) throws IOException {
142-
144+ public void writeDateTime64 (ZonedDateTime value , int scale , ZoneId targetTz ) throws IOException {
145+ SerializerUtils . writeDateTime64 ( out , value , scale , targetTz );
143146 }
144147
145148 public void writeEnum8 (byte value ) throws IOException {
@@ -164,54 +167,6 @@ public void writeIPV6Address(Inet6Address value) throws IOException {
164167 BinaryStreamUtils .writeInet6Address (out , value );
165168 }
166169
167- public void writeArray () throws IOException {
168-
169- }
170-
171- public void writeTuple () throws IOException {
172-
173- }
174-
175- public void writeMap () throws IOException {
176-
177- }
178-
179- public void writeAggregationFunction () throws IOException {
180-
181- }
182-
183- public void writeSimpleFunction () throws IOException {
184-
185- }
186-
187- public void writeGeoPoint () throws IOException {
188-
189- }
190-
191- public void writeGeoRing () throws IOException {
192-
193- }
194-
195- public void writeGeoLineString () throws IOException {
196-
197- }
198-
199- public void writeGeoMultiLineString () throws IOException {
200-
201- }
202-
203- public void writeGeoPolygon () throws IOException {
204-
205- }
206-
207- public void writeGeoMultiPolygon () throws IOException {
208-
209- }
210-
211- public void writeNested () throws IOException {
212-
213- }
214-
215170 public static boolean writeValuePreamble (OutputStream out , boolean defaultsSupport , ClickHouseColumn column , Object value ) throws IOException {
216171 return writeValuePreamble (out , defaultsSupport , value , column .isNullable (), column .getDataType (), column .hasDefault (), column .getColumnName ());
217172 }
@@ -256,4 +211,8 @@ public static boolean writeValuePreamble(OutputStream out, boolean defaultsSuppo
256211
257212 return true ;
258213 }
214+
215+ public static void writeSize (OutputStream out , long size ) throws IOException {
216+ SerializerUtils .writeVarInt (out , size );
217+ }
259218}
0 commit comments