Example #1
0
  @Override
  public Object clone() throws CloneNotSupportedException {
    WindowAggNode grp = (WindowAggNode) super.clone();
    if (partitionKeys != null) {
      grp.partitionKeys = new Column[partitionKeys.length];
      for (int i = 0; i < partitionKeys.length; i++) {
        grp.partitionKeys[i] = partitionKeys[i];
      }
    }

    if (windowFuncs != null) {
      grp.windowFuncs = new WindowFunctionEval[windowFuncs.length];
      for (int i = 0; i < windowFuncs.length; i++) {
        grp.windowFuncs[i] = (WindowFunctionEval) windowFuncs[i].clone();
      }
    }

    if (targets != null) {
      grp.targets = new ArrayList<>();
      for (Target t : targets) {
        grp.targets.add((Target) t.clone());
      }
    }

    return grp;
  }
Example #2
0
  private static void compileProjectableNode(
      CompilationContext context, Schema schema, Projectable node) {
    List<Target> targets;
    if (node.hasTargets()) {
      targets = node.getTargets();
    } else {
      targets = PlannerUtil.schemaToTargets(node.getOutSchema());
    }

    for (Target target : targets) {
      compileIfAbsent(context, schema, target.getEvalTree());
    }
  }
Example #3
0
  @Override
  public LogicalNode visitTableSubQuery(
      CompilationContext context,
      LogicalPlan plan,
      LogicalPlan.QueryBlock block,
      TableSubQueryNode node,
      Stack<LogicalNode> stack)
      throws TajoException {
    stack.push(node);
    visit(context, plan, null, node.getSubQuery(), stack);
    stack.pop();

    if (node.hasTargets()) {
      for (Target target : node.getTargets()) {
        compileIfAbsent(context, node.getLogicalSchema(), target.getEvalTree());
      }
    }

    return node;
  }