This commit is contained in:
zyyang 2021-01-21 14:41:06 +08:00
parent e783e017e1
commit 9a55077b7c
1 changed files with 48 additions and 48 deletions

View File

@ -42,13 +42,13 @@ public class TdEngineSuperDataGen {
long startTime = System.currentTimeMillis();
try {
for (long i = 0; i < rowCount; i++) {
sb = new StringBuilder("insert into " + kv.getKey() + " using sdata tags(" + kv.getValue() + ","
+ kv.getKey() + ") values('");
sb = new StringBuilder("insert into " + kv.getKey() + " using sdata tags(" + kv.getValue() + "," + kv.getKey() + ") values('");
d = d.plusSeconds(1);
sb.append(d.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.MS")));
sb.append("'," + i + "," + r.nextInt(100) + "," + r.nextInt(100) + ",'");
sb.append(DigestUtils.md5Hex(d.toString()));
sb.append("')");
System.out.println("SQL >>> " + sb.toString());
stmt.executeUpdate(sb.toString());
}
} catch (SQLException e) {