Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
Description
In DrillPushProjIntoScan, a new scan and a new projection are created using PrelUtil#getColumn(RelDataType, List<RexNode>).
The returned ProjectPushInfo instance has several fields, one of them is desiredFields which is the list of projected fields. There's one instance per RexNode but because instances were initially added to a set, they might not be in the same order as the order they were created.
The issue happens in the following code:
List<RexNode> newProjects = Lists.newArrayList();
for (RexNode n : proj.getChildExps()) {
newProjects.add(n.accept(columnInfo.getInputRewriter()));
}
This code creates a new list of projects out of the initial ones, by mapping the indices from the old projects to the new projects, but the indices of the new RexNode instances might be out of order (because of the ordering of desiredFields). And if indices are out of order, the check ProjectRemoveRule.isTrivial(newProj) will fail.
My guess is that desiredFields ordering should be preserved when instances are added, to satisfy the condition above.
Attachments
Issue Links
- blocks
-
DRILL-4334 tests in TestMongoFilterPushDown fail in Java 8
- Closed
- is related to
-
DRILL-4468 Aggregates over empty input might fail
- Open