/** * Creates a new node with a single input for the optimizer plan. * * @param pactContract * The PACT that the node represents. */ public TwoInputNode(DualInputOperator<?, ?, ?, ?> pactContract) { super(pactContract); int[] k1 = pactContract.getKeyColumns(0); int[] k2 = pactContract.getKeyColumns(1); this.keys1 = k1 == null || k1.length == 0 ? null : new FieldList(k1); this.keys2 = k2 == null || k2.length == 0 ? null : new FieldList(k2); if (this.keys1 != null) { if (this.keys2 != null) { if (this.keys1.size() != this.keys2.size()) { throw new CompilerException("Unequal number of key fields on the two inputs."); } } else { throw new CompilerException("Keys are set on first input, but not on second."); } } else if (this.keys2 != null) { throw new CompilerException("Keys are set on second input, but not on first."); } this.possibleProperties = getPossibleProperties(); }
/** * Creates a new node with a single input for the optimizer plan. * * @param pactContract * The PACT that the node represents. */ public TwoInputNode(DualInputOperator<?, ?, ?, ?> pactContract) { super(pactContract); int[] k1 = pactContract.getKeyColumns(0); int[] k2 = pactContract.getKeyColumns(1); this.keys1 = k1 == null || k1.length == 0 ? null : new FieldList(k1); this.keys2 = k2 == null || k2.length == 0 ? null : new FieldList(k2); if (this.keys1 != null) { if (this.keys2 != null) { if (this.keys1.size() != this.keys2.size()) { throw new CompilerException("Unequal number of key fields on the two inputs."); } } else { throw new CompilerException("Keys are set on first input, but not on second."); } } else if (this.keys2 != null) { throw new CompilerException("Keys are set on second input, but not on first."); } this.possibleProperties = getPossibleProperties(); }
int[] localPositions1 = contract.getKeyColumns(0); int[] localPositions2 = contract.getKeyColumns(1); Class<? extends Key<?>>[] types = recContract.getKeyClasses();
int[] localPositions1 = contract.getKeyColumns(0); int[] localPositions2 = contract.getKeyColumns(1); Class<? extends Key<?>>[] types = recContract.getKeyClasses();