The current derivceRecordType() method does not correctly add the grouping set index column as documented in the current specification for Aggregate:
Direct Output Order: The list of grouping expressions in declaration order followed by the list of measures in declaration order, followed by an i32 describing the associated particular grouping set the value is derived from (if applicable).
https://substrait.io/relations/logical_relations/#aggregate-operation
|
protected Type.Struct deriveRecordType() { |
|
return TypeCreator.REQUIRED.struct( |
|
Stream.concat( |
|
// unique grouping expressions |
|
getGroupings().stream() |
|
.flatMap(g -> g.getExpressions().stream()) |
|
.collect(Collectors.toCollection(LinkedHashSet::new)) |
|
.stream() |
|
.map(Expression::getType), |
|
|
|
// measures |
|
getMeasures().stream().map(t -> t.getFunction().getType()))); |
|
} |
This was uncovered in #508 which fixes the nullability for grouping set columns.
The current
derivceRecordType()method does not correctly add the grouping set index column as documented in the current specification for Aggregate:https://substrait.io/relations/logical_relations/#aggregate-operation
substrait-java/core/src/main/java/io/substrait/relation/Aggregate.java
Lines 23 to 35 in 4ae8188
This was uncovered in #508 which fixes the nullability for grouping set columns.