huaxingao commented on code in PR #6252:
URL: https://github.com/apache/iceberg/pull/6252#discussion_r1033050893
##########
api/src/main/java/org/apache/iceberg/expressions/BoundAggregate.java:
##########
@@ -37,11 +37,34 @@ public BoundReference<?> ref() {
return term().ref();
}
+ public Types.NestedField nestedField(int index) {
+ if (op() == Operation.COUNT_STAR) {
+ return Types.NestedField.required(index, "COUNT(*)",
Types.LongType.get());
+ } else if (op() == Operation.COUNT) {
+ return Types.NestedField.required(
+ index, "COUNT(" + term().ref().name() + ")", Types.LongType.get());
Review Comment:
@rdblue Thanks for your comment.
Seems to me that we can't aggregate on a transformed reference.
I currently have
```
public class BoundAggregate<T, C> extends Aggregate<BoundTerm<T>> implements
Bound<C>
```
Should I change to the following?
```
public class BoundAggregate<T, C> extends Aggregate<BoundReference<T>>
implements Bound<C>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]