Skip to content

Commit

Permalink
fix InsertClientHttpCompressionTests.insertSimplePOJOs test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
abcfy2 committed Feb 1, 2025
1 parent f5ecac8 commit a12c795
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import java.math.BigInteger;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;

Expand Down Expand Up @@ -145,6 +147,22 @@ public void writeDateTime64(ZonedDateTime value, int scale, ZoneId targetTz) thr
SerializerUtils.writeDateTime64(out, value, scale, targetTz);
}

public void writeDateTime32(OffsetDateTime value) throws IOException {
SerializerUtils.writeDateTime32(out, value, null);
}

public void writeDateTime64(OffsetDateTime value, int scale) throws IOException {
SerializerUtils.writeDateTime64(out, value, scale, null);
}

public void writeDateTime32(Instant value) throws IOException {
SerializerUtils.writeDateTime32(out, value, null);
}

public void writeDateTime64(Instant value, int scale) throws IOException {
SerializerUtils.writeDateTime64(out, value, scale, null);
}

public void writeEnum8(byte value) throws IOException {
BinaryStreamUtils.writeEnum8(out, value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,12 @@ public void testWriter() throws Exception {
if (row[4] == null) {
formatWriter.writeDefault();
} else {
formatWriter.writeString((String) row[4]);
formatWriter.writeDateTime((ZonedDateTime) row[4], null);
}
if (row[5] == null) {
formatWriter.writeDefault();
} else {
formatWriter.writeInt8((byte) row[5]);
formatWriter.writeInt8(((Integer) row[5]).byteValue());
}
}
}, ClickHouseFormat.RowBinaryWithDefaults, new InsertSettings()).get()) {
Expand Down

0 comments on commit a12c795

Please sign in to comment.