public ClusterSchemaTree getMatchedSchemaWithTemplate(final PartialPath devicePath) {
    final ClusterSchemaTree tree = new ClusterSchemaTree();
    final IDeviceSchema schema = tableDeviceSchemaCache.getDeviceSchema(devicePath.getNodes());
    if (!(schema instanceof TreeDeviceTemplateSchema)) {
      return tree;
    }
    final TreeDeviceTemplateSchema treeSchema = (TreeDeviceTemplateSchema) schema;
    Template template = templateManager.getTemplate(treeSchema.getTemplateId());
    tree.appendTemplateDevice(devicePath, template.isDirectAligned(), template.getId(), template);
    tree.setDatabases(Collections.singleton(treeSchema.getDatabase()));
    return tree;
  }
Get schema info under the given device if the device path is a template activated path.

@param devicePath full path of the device
@return empty if cache miss or the device path is not a template activated path
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceSchemaCacheManager.java