This commit is contained in:
zyyang 2020-12-22 09:23:21 +08:00
parent 702af6e3cb
commit e6154984e6
2 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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();