Skip to content

Commit 12a0d2a

Browse files
committed
Use date fromat from a Util class
1 parent 7d6c01b commit 12a0d2a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

client-v2/src/main/java/com/clickhouse/client/api/data_formats/internal/AbstractBinaryFormatReader.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,9 @@ public abstract class AbstractBinaryFormatReader implements ClickHouseBinaryForm
5151
protected BinaryStreamReader binaryStreamReader;
5252

5353
private TableSchema schema;
54-
5554
private ClickHouseColumn[] columns;
56-
5755
private Map[] convertions;
58-
5956
private volatile boolean hasNext = true;
60-
61-
private DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
6257
private volatile boolean initialState = true; // reader is in initial state, no records have been read yet
6358

6459
protected AbstractBinaryFormatReader(InputStream inputStream, QuerySettings querySettings, TableSchema schema,
@@ -284,7 +279,7 @@ public String getString(String colName) {
284279
ClickHouseDataType dataType = schema.getColumnByName(colName).getDataType();
285280
ZonedDateTime zdt = (ZonedDateTime) value;
286281
if (dataType == ClickHouseDataType.Date) {
287-
return zdt.format(dateTimeFormatter).toString();
282+
return zdt.format(com.clickhouse.client.api.DataTypeUtils.DATE_FORMATTER).toString();
288283
}
289284
return value.toString();
290285
} else {

0 commit comments

Comments
 (0)