/**
   * @param operand The operand of the function
   * @param targetType The type of the result. Timestamp or Date.
   * @exception StandardException Thrown on error
   */
  public void init(Object operand, Object targetType) throws StandardException {
    setType((DataTypeDescriptor) targetType);
    switch (getTypeServices().getJDBCTypeId()) {
      case Types.DATE:
        super.init(operand, "date", DATE_METHOD_NAME);
        break;

      case Types.TIMESTAMP:
        super.init(operand, "timestamp", TIMESTAMP_METHOD_NAME);
        break;

      default:
        if (SanityManager.DEBUG) SanityManager.NOTREACHED();
        super.init(operand);
    }
  }
  /**
   * @param operand The operand of the function
   * @param targetType The type of the result. Timestamp or Date.
   * @exception StandardException Thrown on error
   */
  public void init(Object operand, Object targetType) throws StandardException {
    setType((DataTypeDescriptor) targetType);
    switch (getType().getJDBCTypeId()) {
      case Types.DATE:
        super.init(operand, "date", DATE_METHOD_NAME);
        break;

      case Types.TIME:
        super.init(operand, "time", TIME_METHOD_NAME);
        break;

      case Types.TIMESTAMP:
        super.init(operand, "timestamp", TIMESTAMP_METHOD_NAME);
        break;

      default:
        assert false;
        super.init(operand);
    }
  }
예제 #3
0
  public void setNextPartialSolution(OptimizerNode solutionSetDelta, OptimizerNode nextWorkset) {
    // check whether the next partial solution is itself the join with
    // the partial solution (so we can potentially do direct updates)
    if (solutionSetDelta instanceof TwoInputNode) {
      TwoInputNode solutionDeltaTwoInput = (TwoInputNode) solutionSetDelta;
      if (solutionDeltaTwoInput.getFirstPredecessorNode() == this.solutionSetNode
          || solutionDeltaTwoInput.getSecondPredecessorNode() == this.solutionSetNode) {
        this.solutionDeltaImmediatelyAfterSolutionJoin = true;
      }
    }

    // attach an extra node to the solution set delta for the cases where we need to repartition
    UnaryOperatorNode solutionSetDeltaUpdateAux =
        new UnaryOperatorNode(
            "Solution-Set Delta",
            getSolutionSetKeyFields(),
            new SolutionSetDeltaOperator(getSolutionSetKeyFields()));
    solutionSetDeltaUpdateAux.setDegreeOfParallelism(getDegreeOfParallelism());
    solutionSetDeltaUpdateAux.setSubtasksPerInstance(getSubtasksPerInstance());

    PactConnection conn = new PactConnection(solutionSetDelta, solutionSetDeltaUpdateAux);
    solutionSetDeltaUpdateAux.setIncomingConnection(conn);
    solutionSetDelta.addOutgoingConnection(conn);

    this.solutionSetDelta = solutionSetDeltaUpdateAux;
    this.nextWorkset = nextWorkset;

    this.singleRoot = new SingleRootJoiner();
    this.solutionSetDeltaRootConnection =
        new PactConnection(solutionSetDeltaUpdateAux, this.singleRoot);
    this.nextWorksetRootConnection = new PactConnection(nextWorkset, this.singleRoot);
    this.singleRoot.setInputs(this.solutionSetDeltaRootConnection, this.nextWorksetRootConnection);

    solutionSetDeltaUpdateAux.addOutgoingConnection(this.solutionSetDeltaRootConnection);
    nextWorkset.addOutgoingConnection(this.nextWorksetRootConnection);
  }
 /**
  * Initializer for a UnaryLogicalOperatorNode
  *
  * @param operand The operand of the operator
  * @param methodName The name of the method to call in the generated class. In this case, it's
  *     actually an operator name.
  */
 @Override
 public void init(Object operand, Object methodName) {
   /* For logical operators, the operator and method names are the same */
   super.init(operand, methodName, methodName);
 }
 /**
  * Initializer for a UnaryLogicalOperatorNode
  *
  * @param operand The operand of the operator
  * @param methodName The name of the method to call in the generated class. In this case, it's
  *     actually an operator name.
  */
 public void init(Object operand, Object methodName) throws StandardException {
   /* For logical operators, the operator and method names are the same */
   super.init(operand, methodName, methodName);
 }