public Map<String, TsTable> getSpecificTablesUnderSpecificDatabase(
      final PartialPath databasePath, final Set<String> tables) throws MetadataException {
    final IConfigMNode databaseNode = getDatabaseNodeByDatabasePath(databasePath).getAsMNode();
    final Map<String, TsTable> result = new HashMap<>();
    tables.forEach(
        table -> {
          final IConfigMNode child = databaseNode.getChildren().get(table);
          if (child instanceof ConfigTableNode
              && ((ConfigTableNode) child).getStatus().equals(TableNodeStatus.USING)) {
            result.put(table, ((ConfigTableNode) child).getTable());
          } else {
            result.put(table, null);
          }
        });
    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