Skip to content

Commit 0709cb6

Browse files
committed
switched to another format
1 parent 0f0d82e commit 0709cb6

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public void testExecuteUpdateDates() throws Exception {
264264
}
265265
}
266266

267-
private static final int ASYNC_INSERT_SETTINGS_DP_ROWS = 1000_000;
267+
private static final int ASYNC_INSERT_SETTINGS_DP_ROWS = 100_000;
268268

269269
@DataProvider(name = "asyncInsertSettingsDP")
270270
public static Object[][] asyncInsertSettingsDP() {
@@ -289,13 +289,16 @@ public void testInsertWithAsyncInsert(String asyncInsert, String waitAsyncInsert
289289

290290
try (Connection conn = getJdbcConnection(props)) {
291291
try (Statement stmt = conn.createStatement()) {
292-
stmt.execute("CREATE TABLE IF NOT EXISTS " + getDatabase() + "." + tableName + " (id UInt32) ENGINE = MergeTree ORDER BY id");
292+
stmt.execute("CREATE TABLE IF NOT EXISTS " + getDatabase() + "." + tableName + " (id UInt32, name String, value Float64, status Int8, timestamp DateTime) ENGINE = MergeTree ORDER BY id");
293293
stmt.execute("TRUNCATE TABLE " + getDatabase() + "." + tableName);
294294

295-
StringBuilder sb = new StringBuilder("INSERT INTO " + getDatabase() + "." + tableName + " VALUES ");
295+
StringBuilder sb = new StringBuilder("INSERT INTO " + getDatabase() + "." + tableName + " FORMAT TSV\n");
296296
for (int i = 0; i < ASYNC_INSERT_SETTINGS_DP_ROWS; i++) {
297-
if (i > 0) sb.append(", ");
298-
sb.append("(").append(i).append(")");
297+
sb.append(i).append("\t")
298+
.append("name_").append(i).append("\t")
299+
.append(i * 1.1).append("\t")
300+
.append(i % 2).append("\t")
301+
.append("2023-01-01 10:11:12").append("\n");
299302
}
300303

301304
int updateCount = stmt.executeUpdate(sb.toString());

0 commit comments

Comments
 (0)