public Object updateAggregatingValue(Session session, Object currValue) {

    if (currValue == null) {
      currValue = new SetFunction(opType, nodes[LEFT].dataType, isDistinctAggregate);
    }

    Object newValue =
        nodes[LEFT].opType == OpTypes.ASTERISK
            ? ValuePool.INTEGER_1
            : nodes[LEFT].getValue(session);

    ((SetFunction) currValue).add(session, newValue);

    return currValue;
  }
  public void resolveTypes(Session session, Expression parent) {

    for (int i = 0; i < nodes.length; i++) {
      if (nodes[i] != null) {
        nodes[i].resolveTypes(session, this);
      }
    }

    if (nodes[LEFT].isParam) {
      throw Error.error(ErrorCode.X_42567);
    }

    if (isDistinctAggregate) {
      if (nodes[LEFT].dataType.isLobType()) {
        throw Error.error(ErrorCode.X_42534);
      }
    }

    dataType = SetFunction.getType(opType, nodes[LEFT].dataType);
  }