// HELPER METHODS:
static Tuple GenerateGroupByInput(Datum groupLabel, List<Integer> groupCols, int numInputFields) throws IOException {
Tuple inputConst = new Tuple(numInputFields);
Tuple inputConstraint = new ExampleTuple();
inputConstraint.copyFrom(inputConst);
if (groupLabel != null) {
if (groupCols.size() == 1) { // group by one column, so group label is a data atom
inputConstraint.setField(groupCols.get(0), groupLabel);
} else { // group by multiple columns, so group label is a tuple
if (!(groupLabel instanceof Tuple)) throw new RuntimeException("Unexpected group label type.");