public void validate(List<PartialPath> sourceDevices, List<Expression> sourceColumns) {
    boolean isAllRawSeriesQuery = checkIsAllRawSeriesQuery(sourceColumns);

    if (!isAllRawSeriesQuery && isMeasurementsExistPlaceholder()) {
      throw new SemanticException(FORBID_PLACEHOLDER_ERROR_MSG);
    }

    if (isDeviceExistPlaceholder()) {
      if (intoItems.size() != 1) {
        throw new SemanticException(PLACEHOLDER_MISMATCH_ERROR_MSG);
      }
    } else {
      if (intoItems.size() != sourceDevices.size()) {
        throw new SemanticException(DEVICE_NUM_MISMATCH_ERROR_MSG);
      }
    }

    for (IntoItem intoItem : intoItems) {
      List<String> intoMeasurements = intoItem.getIntoMeasurements();
      if (intoItem.isMeasurementsExistPlaceholder()) {
        if (intoMeasurements.size() != 1) {
          throw new SemanticException(PLACEHOLDER_MISMATCH_ERROR_MSG);
        }
      } else {
        if (intoMeasurements.size() != sourceColumns.size()) {
          throw new SemanticException(PATH_NUM_MISMATCH_ERROR_MSG);
        }
      }
    }
  }
This class maintains information of {@code INTO} clause.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/component/IntoComponent.java