@Override
      protected List<Expression> visitSimpleCaseExpression(
          SimpleCaseExpression node, Scope context) {
        List<Expression> firstResult = process(node.getOperand(), context);
        ImmutableList.Builder<List<Expression>> whenResultListBuilder =
            new ImmutableList.Builder<>();
        node.getWhenClauses().forEach(when -> whenResultListBuilder.add(process(when, context)));
        List<List<Expression>> whenResultList = whenResultListBuilder.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 firstSize = firstResult.size();
        int secondSize = secondResult == null ? 0 : secondResult.size();
        int maxSize = whenResultList.stream().mapToInt(List::size).max().orElse(0);
        maxSize = Math.max(Math.max(firstSize, 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[whenResultList.size()];
        AtomicInteger firstIndex = (firstSize == maxSize) ? baseIndex : new AtomicInteger(0);
        for (int i = 0; i < childrenIndexes.length; i++) {
          childrenIndexes[i] =
              (whenResultList.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) whenResultList.get(j).get(operandIndexInResult));
          }

          resultBuilder.add(
              new SimpleCaseExpression(
                  firstResult.get(firstIndex.get()),
                  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