@Test
  public void testDropTagsOrAttributes() {
    try {
      // create timeseries with tags and attributes
      prepareTimeseries();
      // add tags and attributes after create
      Set<String> keySet =
          new HashSet<>(Arrays.asList("tag1", "tag2", "tag3", "attr1", "attr2", "attr3"));
      Map<String, String> newTags =
          new HashMap<String, String>() {
            {
              put("tag2", "new2");
              put("tag3", "new3");
            }
          };
      schemaRegion.addTags(newTags, new PartialPath("root.sg.wf01.wt01.v1.s1"));
      schemaRegion.addTags(newTags, new PartialPath("root.sg.wf01.aligned_device1.s1"));
      Map<String, String> newAttributes =
          new HashMap<String, String>() {
            {
              put("attr2", "new2");
              put("attr3", "new3");
            }
          };
      schemaRegion.addAttributes(newAttributes, new PartialPath("root.sg.wf01.wt01.v1.s1"));
      schemaRegion.addAttributes(newAttributes, new PartialPath("root.sg.wf01.aligned_device1.s1"));
      // drop all tags and attributes then check
      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");
      for (String fullPath : fullPaths) {
        schemaRegion.dropTagsOrAttributes(keySet, new PartialPath(fullPath));
        checkTags(fullPath, Collections.emptyMap());
        checkAttributes(fullPath, Collections.emptyMap());
      }
    } 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