提交 e6154984 编写于 作者: Z zyyang

change

上级 702af6e3
...@@ -35,10 +35,10 @@ public class TaosDemoApplication { ...@@ -35,10 +35,10 @@ public class TaosDemoApplication {
System.exit(0); System.exit(0);
} }
DataSource dataSource = DataSourceFactory.getInstance(config.host, config.port, config.user, config.password); final DataSource dataSource = DataSourceFactory.getInstance(config.host, config.port, config.user, config.password);
DatabaseService databaseService = new DatabaseService(dataSource); final DatabaseService databaseService = new DatabaseService(dataSource);
SuperTableService superTableService = new SuperTableService(dataSource); final SuperTableService superTableService = new SuperTableService(dataSource);
SubTableService subTableService = new SubTableService(dataSource); final SubTableService subTableService = new SubTableService(dataSource);
// 创建数据库 // 创建数据库
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
...@@ -85,7 +85,7 @@ public class TaosDemoApplication { ...@@ -85,7 +85,7 @@ public class TaosDemoApplication {
start = System.currentTimeMillis(); start = System.currentTimeMillis();
if (config.doCreateTable) { if (config.doCreateTable) {
superTableService.create(superTableMeta); superTableService.create(superTableMeta);
if (!config.autoCreateTable){ if (!config.autoCreateTable) {
// 批量建子表 // 批量建子表
subTableService.createSubTable(superTableMeta, config.numOfTables, config.prefixOfTable, config.numOfThreadsForCreate); subTableService.createSubTable(superTableMeta, config.numOfTables, config.prefixOfTable, config.numOfThreadsForCreate);
} }
......
...@@ -48,7 +48,7 @@ public class SqlSpeller { ...@@ -48,7 +48,7 @@ public class SqlSpeller {
sb.append("create table if not exists ").append(subTableMeta.getDatabase()).append(".").append(subTableMeta.getName()).append(" "); sb.append("create table if not exists ").append(subTableMeta.getDatabase()).append(".").append(subTableMeta.getName()).append(" ");
sb.append("using ").append(subTableMeta.getDatabase()).append(".").append(subTableMeta.getSupertable()).append(" "); sb.append("using ").append(subTableMeta.getDatabase()).append(".").append(subTableMeta.getSupertable()).append(" ");
String tagStr = subTableMeta.getTags().stream().filter(Objects::nonNull) String tagStr = subTableMeta.getTags().stream().filter(Objects::nonNull)
.map(tagValue -> tagValue.getName() + " " + tagValue.getValue() + " ") .map(tagValue -> tagValue.getName() + " '" + tagValue.getValue() + "' ")
.collect(Collectors.joining(",", "(", ")")); .collect(Collectors.joining(",", "(", ")"));
sb.append("tags ").append(tagStr); sb.append("tags ").append(tagStr);
return sb.toString(); return sb.toString();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册