public Map<String, List<TsTable>> getAllPreCreateTables() throws MetadataException {
    final Map<String, List<TsTable>> result = new HashMap<>();
    final List<PartialPath> databaseList = getAllDatabasePaths(true);
    for (final PartialPath databasePath : databaseList) {
      final String database = databasePath.getFullPath().substring(ROOT.length() + 1);
      final IConfigMNode databaseNode = getDatabaseNodeByDatabasePath(databasePath).getAsMNode();
      for (final IConfigMNode child : databaseNode.getChildren().values()) {
        if (child instanceof ConfigTableNode) {
          final ConfigTableNode tableNode = (ConfigTableNode) child;
          if (!tableNode.getStatus().equals(TableNodeStatus.PRE_CREATE)) {
            continue;
          }
          result.computeIfAbsent(database, k -> new ArrayList<>()).add(tableNode.getTable());
        }
      }
    }
    return result;
  }
This method returns the templateId set on paths if the path set matches or is a prefix of input
path pattern.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java