@Test
  public void testSetTagsOrAttributesValue() {
    try {
      prepareTimeseries();
      Map<String, String> tagsOrAttributesValue =
          new HashMap<String, String>() {
            {
              put("tag1", "new1");
              put("attr1", "new1");
            }
          };
      List<String> fullPaths =
          Arrays.asList(
              "root.sg.wf01.wt01.v1.s1",
              "root.sg.wf01.wt01.v1.s2",
              "root.sg.wf01.aligned_device1.s1",
              "root.sg.wf01.aligned_device1.s2",
              "root.sg.wf01.aligned_device2.s1",
              "root.sg.wf01.aligned_device2.s2");
      List<Boolean> expectException = Arrays.asList(true, false, true, true, false, true);
      for (int i = 0; i < fullPaths.size(); i++) {
        try {
          schemaRegion.setTagsOrAttributesValue(
              tagsOrAttributesValue, new PartialPath(fullPaths.get(i)));
          Assert.assertFalse(expectException.get(i));
        } catch (Exception e) {
          Assert.assertTrue(expectException.get(i));
          Assert.assertTrue(e.getMessage().contains("does not have"));
        }
      }
      checkAttributes(
          "root.sg.wf01.wt01.v1.s2",
          new HashMap<String, String>() {
            {
              put("attr1", "new1");
              put("attr2", "a2");
            }
          });
      checkTags(
          "root.sg.wf01.wt01.v1.s2",
          new HashMap<String, String>() {
            {
              put("tag1", "new1");
              put("tag2", "t2");
            }
          });
      checkAttributes(
          "root.sg.wf01.aligned_device2.s1",
          new HashMap<String, String>() {
            {
              put("attr1", "new1");
            }
          });
      checkTags(
          "root.sg.wf01.aligned_device2.s1",
          new HashMap<String, String>() {
            {
              put("tag1", "new1");
            }
          });
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
Prepare timeseries

<p>"root.sg.wf01.wt01.v1.s1" without tags, attributes and alias

<p>"root.sg.wf01.wt01.v1.s2" with tags, attributes and alias

<p>"root.sg.wf01.aligned_device1.(s1,s2)" aligned without tags, attributes and alias

<p>"root.sg.wf01.aligned_device2.(s1,s2)" aligned with tags, attributes and alias
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaRegionAliasAndTagTest.java