File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
client-v2/src/test/java/com/clickhouse/client/datatypes Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff 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 ('-' , '_' );
You can’t perform that action at this time.
0 commit comments