@Override
    protected IrRowPattern visitIrPermutation(IrPermutation node, Boolean inExclusion) {
      // process children and remove all empty children
      List<IrRowPattern> children =
          node.getPatterns().stream()
              .map(pattern -> process(pattern, inExclusion))
              .filter(child -> !(child instanceof IrEmpty))
              .collect(toImmutableList());

      if (children.isEmpty()) {
        return new IrEmpty();
      }
      if (children.size() == 1) {
        return children.get(0);
      }
      return new IrPermutation(children);
    }
Remove all empty branches from the permutation. Examples: PERMUTE(A, (), B, ()) -> PERMUTE(A,
B) PERMUTE((), A) -> A PERMUTE((), ()) -> ()

@return the IrPermutation containing no empty branches, or a sub-pattern in case when the
    permutation is reduced to a single branch, or IrEmpty in case when all sub-patterns are
    empty
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/rowpattern/IrRowPatternFlattener.java