Search in sources :

Example 1 with MetadataControllerPrel

use of org.apache.drill.exec.planner.physical.MetadataControllerPrel in project drill by apache.

the class StarColumnConverter method visitPrel.

@Override
public Prel visitPrel(Prel prel, Void value) throws RuntimeException {
    if (prel instanceof MetadataControllerPrel) {
        // disallow renaming projections for analyze command
        return prel;
    }
    // Require prefix rename : there exists other expression, in addition to a star column.
    if (// not set yet.
    !prefixedForStar && StarColumnHelper.containsStarColumn(prel.getRowType()) && prel.getRowType().getFieldNames().size() > 1) {
        prefixedForStar = true;
    }
    List<RelNode> children = Lists.newArrayList();
    for (Prel child : prel) {
        child = child.accept(this, null);
        children.add(child);
    }
    return (Prel) prel.copy(prel.getTraitSet(), children);
}
Also used : RelNode(org.apache.calcite.rel.RelNode) MetadataControllerPrel(org.apache.drill.exec.planner.physical.MetadataControllerPrel) ScanPrel(org.apache.drill.exec.planner.physical.ScanPrel) Prel(org.apache.drill.exec.planner.physical.Prel) ProjectAllowDupPrel(org.apache.drill.exec.planner.physical.ProjectAllowDupPrel) ProjectPrel(org.apache.drill.exec.planner.physical.ProjectPrel) ScreenPrel(org.apache.drill.exec.planner.physical.ScreenPrel) WriterPrel(org.apache.drill.exec.planner.physical.WriterPrel) UnnestPrel(org.apache.drill.exec.planner.physical.UnnestPrel) MetadataControllerPrel(org.apache.drill.exec.planner.physical.MetadataControllerPrel) LeafPrel(org.apache.drill.exec.planner.physical.LeafPrel)

Aggregations

RelNode (org.apache.calcite.rel.RelNode)1 LeafPrel (org.apache.drill.exec.planner.physical.LeafPrel)1 MetadataControllerPrel (org.apache.drill.exec.planner.physical.MetadataControllerPrel)1 Prel (org.apache.drill.exec.planner.physical.Prel)1 ProjectAllowDupPrel (org.apache.drill.exec.planner.physical.ProjectAllowDupPrel)1 ProjectPrel (org.apache.drill.exec.planner.physical.ProjectPrel)1 ScanPrel (org.apache.drill.exec.planner.physical.ScanPrel)1 ScreenPrel (org.apache.drill.exec.planner.physical.ScreenPrel)1 UnnestPrel (org.apache.drill.exec.planner.physical.UnnestPrel)1 WriterPrel (org.apache.drill.exec.planner.physical.WriterPrel)1