提交 e6154984 编写于 作者: Z zyyang

change

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