private void checkIsTemplateCompatible(
      final PartialPath devicePath,
      final List<String> measurements,
      final List<String> aliasList,
      final MPPQueryContext context) {
    DataNodeSchemaLockManager.getInstance()
        .takeReadLock(context, SchemaLockType.TIMESERIES_VS_TEMPLATE);
    for (int i = 0; i < measurements.size(); i++) {
      final Pair<Template, PartialPath> templateInfo =
          schemaFetcher.checkTemplateSetAndPreSetInfo(
              devicePath.concatAsMeasurementPath(measurements.get(i)),
              aliasList == null ? null : aliasList.get(i));
      if (templateInfo != null) {
        throw new SemanticException(
            new TemplateIncompatibleException(
                devicePath.getFullPath() + measurements,
                templateInfo.left.getName(),
                templateInfo.right));
      }
    }
  }
Check datatype consistency in ALIGN BY DEVICE.

<p>an inconsistent example: select s0 from root.sg1.d1, root.sg1.d2 align by device, return
false while root.sg1.d1.s0 is INT32 and root.sg1.d2.s0 is FLOAT.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java