mirror of
https://github.com/actiontech/dble.git
synced 2026-05-24 08:49:56 -05:00
[inner-1478] create vertical view without falling disk
This commit is contained in:
@@ -269,7 +269,7 @@ public class FileSystemRepository implements Repository {
|
||||
* @return
|
||||
*/
|
||||
public String mapToJsonString(Map<String, Map<String, String>> map) {
|
||||
StringBuilder sb = new StringBuilder("[");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Map.Entry<String, Map<String, String>> schema : map.entrySet()) {
|
||||
Map<String, String> schemaSet = schema.getValue();
|
||||
sb.append("{\"schema\":\"").append(schema.getKey()).append("\",\"list\":[");
|
||||
@@ -284,8 +284,11 @@ public class FileSystemRepository implements Repository {
|
||||
}
|
||||
sb.append("},");
|
||||
}
|
||||
if (',' == sb.charAt(sb.length() - 1)) {
|
||||
sb.setCharAt(sb.length() - 1, ']');
|
||||
if (sb.length() != 0) {
|
||||
if (',' == sb.charAt(sb.length() - 1)) {
|
||||
sb.setCharAt(sb.length() - 1, ']');
|
||||
sb.insert(0, "[");
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ViewMeta {
|
||||
public void addMeta(boolean isNeedPersistence) throws SQLNonTransientException {
|
||||
try {
|
||||
tmManager.addMetaLock(schema, viewName, createSql);
|
||||
if (isNeedPersistence) {
|
||||
if (isNeedPersistence && viewQuery instanceof QueryNode) {
|
||||
ProxyMeta.getInstance().getTmManager().getRepository().put(schema, viewName, this.createSql);
|
||||
}
|
||||
tmManager.getCatalogs().get(schema).getViewMetas().put(viewName, this);
|
||||
|
||||
Reference in New Issue
Block a user