add note; conditional

This commit is contained in:
Zoltan Haindrich 2024-11-21 08:12:49 +00:00
parent 0c6b40c138
commit bdfcef8220

View File

@ -72,6 +72,10 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer
protected TrimResult dummyProject(int fieldCount, RelNode input, protected TrimResult dummyProject(int fieldCount, RelNode input,
@Nullable RelNode originalRelNode) @Nullable RelNode originalRelNode)
{ {
if (fieldCount != 0) {
return super.dummyProject(fieldCount, input, originalRelNode);
}
// workaround to support fieldCount == 0 projections
final Mapping mapping = Mappings.create(MappingType.INVERSE_SURJECTION, fieldCount, 0); final Mapping mapping = Mappings.create(MappingType.INVERSE_SURJECTION, fieldCount, 0);
if (input.getRowType().getFieldCount() == 0) { if (input.getRowType().getFieldCount() == 0) {
// there is no need to do anything // there is no need to do anything