@Override
      protected List<Expression> visitSearchedCaseExpression(
          SearchedCaseExpression node, Scope context) {
        ImmutableList.Builder<List<Expression>> firstChildResultListBuilder =
            new ImmutableList.Builder<>();
        node.getWhenClauses()
            .forEach(when -> firstChildResultListBuilder.add(process(when, context)));
        List<List<Expression>> firstChildResultList = firstChildResultListBuilder.build();
        List<Expression> secondResult =
            node.getDefaultValue().isPresent()
                ? process(node.getDefaultValue().get(), context)
                : null;

        if (expandedExpressions == null) {
          // no Columns need to be expanded
          return Collections.singletonList(node);
        }

        ImmutableList.Builder<Expression> resultBuilder = new ImmutableList.Builder<>();
        int secondSize = secondResult == null ? 0 : secondResult.size();
        int maxSize = firstChildResultList.stream().mapToInt(List::size).max().orElse(0);
        maxSize = Math.max(maxSize, secondSize);

        AtomicInteger baseIndex = new AtomicInteger(0);
        // if child is expanded, index of it reference the baseIndex, else the index of it always be
        // 0
        AtomicInteger[] childrenIndexes = new AtomicInteger[firstChildResultList.size()];
        for (int i = 0; i < childrenIndexes.length; i++) {
          childrenIndexes[i] =
              (firstChildResultList.get(i).size() == maxSize) ? baseIndex : new AtomicInteger(0);
        }
        AtomicInteger secondIndex = (secondSize == maxSize) ? baseIndex : new AtomicInteger(0);
        for (int i = 0; i < maxSize; i++) {
          ImmutableList.Builder<WhenClause> operandListBuilder = new ImmutableList.Builder<>();
          for (int j = 0; j < childrenIndexes.length; j++) {
            int operandIndexInResult = childrenIndexes[j].get();
            operandListBuilder.add(
                (WhenClause) firstChildResultList.get(j).get(operandIndexInResult));
          }

          resultBuilder.add(
              new SearchedCaseExpression(
                  operandListBuilder.build(),
                  (secondResult == null ? null : secondResult.get(secondIndex.get()))));
          baseIndex.getAndIncrement();
        }
        return resultBuilder.build();
      }
Check if there is Columns function in expression, and verify they are same if there are multi
Column functions.

@param expression input expression
@return if there is Columns function in expression
@throws SemanticException if there are multi Columns functions but different
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java