Code review comment: My understanding is that the boolean expression for `COUNTIF` aggregate will be computed in a precursory `Project`. As of right now list of supported aggregate functions is limited to: https://github.com/apache/beam/blob/659d84b4be5bdd36b408359a8c69f4eb12771180/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/SqlStdOperatorMappingTable.java#L181-L189

Code under review:
public RelNode convert(ResolvedAggregateScan zetaNode, List<RelNode> inputs) {
    RelNode input = convertAggregateScanInputScanToLogicalProject(zetaNode, inputs.get(0));

    
    int groupFieldsListSize = zetaNode.getGroupByList().size();
    ImmutableBitSet groupSet;
    if (groupFieldsListSize != 0) {
      groupSet =
          ImmutableBitSet.of(
              IntStream.rangeClosed(0, groupFieldsListSize - 1)
                  .boxed()
                  .collect(Collectors.toList()));
    } else {
      groupSet = ImmutableBitSet.of();
    }

    

    List<AggregateCall> aggregateCalls;
    if (zetaNode.getAggregateList().isEmpty()) {
      aggregateCalls = ImmutableList.of();
    } else {
      aggregateCalls = new ArrayList<>();
      
      int columnRefoff = groupFieldsListSize;
      for (ResolvedComputedColumn computedColumn : zetaNode.getAggregateList()) {
        AggregateCall aggCall = convertAggCall(computedColumn, columnRefoff);
        aggregateCalls.add(aggCall);
        if (!aggCall.getArgList().isEmpty()) {
          
          
          columnRefoff++;
        }
      }
    }

    LogicalAggregate logicalAggregate =
        new LogicalAggregate(
            getCluster(),
            input.getTraitSet(),
            input,
            groupSet,
            ImmutableList.of(groupSet),
            aggregateCalls);

    return logicalAggregate;
  }

Line commented on: columnRefoff++;

Revised code:
public RelNode convert(ResolvedAggregateScan zetaNode, List<RelNode> inputs) {
    RelNode input = convertAggregateScanInputScanToLogicalProject(zetaNode, inputs.get(0));

    
    int groupFieldsListSize = zetaNode.getGroupByList().size();
    ImmutableBitSet groupSet;
    if (groupFieldsListSize != 0) {
      groupSet =
          ImmutableBitSet.of(
              IntStream.rangeClosed(0, groupFieldsListSize - 1)
                  .boxed()
                  .collect(Collectors.toList()));
    } else {
      groupSet = ImmutableBitSet.of();
    }

    

    List<AggregateCall> aggregateCalls;
    if (zetaNode.getAggregateList().isEmpty()) {
      aggregateCalls = ImmutableList.of();
    } else {
      aggregateCalls = new ArrayList<>();
      
      int columnRefoff = groupFieldsListSize;
      for (ResolvedComputedColumn computedColumn : zetaNode.getAggregateList()) {
        AggregateCall aggCall = convertAggCall(computedColumn, columnRefoff);
        aggregateCalls.add(aggCall);
        if (!aggCall.getArgList().isEmpty()) {
          
          
          columnRefoff++;
        }
      }
    }

    LogicalAggregate logicalAggregate =
        new LogicalAggregate(
            getCluster(),
            input.getTraitSet(),
            input,
            groupSet,
            ImmutableList.of(groupSet),
            aggregateCalls);

    return logicalAggregate;
  }