public void setTableProperties(
      final PartialPath database, final String tableName, final Map<String, String> tableProperties)
      throws MetadataException {
    final IConfigMNode databaseNode = getDatabaseNodeByDatabasePath(database).getAsMNode();
    if (!databaseNode.hasChild(tableName)) {
      throw new TableNotExistsException(
          database.getFullPath().substring(ROOT.length() + 1), tableName);
    }
    final TsTable table = ((ConfigTableNode) databaseNode.getChild(tableName)).getTable();
    tableProperties.forEach(
        (k, v) -> {
          if (Objects.nonNull(v)) {
            table.addProp(k, v);
          } else if (k.equals(TsTable.TTL_PROPERTY)
              && databaseNode.getDatabaseSchema().isSetTTL()
              && databaseNode.getDatabaseSchema().getTTL() != Long.MAX_VALUE) {
            table.addProp(k, String.valueOf(databaseNode.getDatabaseSchema().getTTL()));
          } else {
            table.removeProp(k);
          }
        });
  }
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