Skip to content

Commit 58de2b1

Browse files
author
Paultagoras
committed
Update RowBinaryFormatWriterTest.java
1 parent b69d9e7 commit 58de2b1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

client-v2/src/test/java/com/clickhouse/client/datatypes/RowBinaryFormatWriterTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,28 @@ public Field set(Object comparisonValue) {//For comparison purposes
152152

153153

154154

155+
@Test (groups = { "integration" })
156+
public void writeMissingFieldsTest() throws Exception {
157+
String tableName = "rowBinaryFormatWriterTest_writeNumbersTest_" + UUID.randomUUID().toString().replace('-', '_');
158+
String tableCreate = "CREATE TABLE \"" + tableName + "\" " +
159+
" (id Int32, " +
160+
" int8 Int8, int8_nullable Nullable(Int8), int8_default Int8 DEFAULT 3 " +
161+
" ) Engine = MergeTree ORDER BY id";
162+
163+
// Insert random (valid) values
164+
long seed = System.currentTimeMillis();
165+
Random rand = new Random(seed);
166+
System.out.println("Random seed: " + seed);
167+
168+
Field[][] rows = new Field[][] {{
169+
new Field("id", 1), //Row ID
170+
new Field("int8", rand.nextInt(256) - 128)//Missing the nullable and default fields
171+
}};
172+
173+
writeTest(tableName, tableCreate, rows);
174+
}
175+
176+
155177
@Test (groups = { "integration" })
156178
public void writeNumbersTest() throws Exception {
157179
String tableName = "rowBinaryFormatWriterTest_writeNumbersTest_" + UUID.randomUUID().toString().replace('-', '_');

0 commit comments

Comments
 (0)