/** * @see org.teiid.query.processor.relational.RelationalNode#getNodeString(java.lang.StringBuffer) * @since 4.2 */ protected void getNodeString(StringBuffer str) { str.append(getClassName()); str.append("("); //$NON-NLS-1$ str.append(getID()); str.append(") [");//$NON-NLS-1$ if(isDependent()) { str.append("Dependent] [");//$NON-NLS-1$ } str.append(this.joinStrategy.toString()); str.append("] [");//$NON-NLS-1$ str.append(this.joinType.toString()); str.append("]"); //$NON-NLS-1$ if (getJoinType() != JoinType.JOIN_CROSS) { str.append(" criteria=").append(getCriteriaList()); //$NON-NLS-1$ } str.append(" output="); //$NON-NLS-1$ str.append(getElements()); }
/** * @see org.teiid.query.processor.relational.RelationalNode#getNodeString(java.lang.StringBuffer) * @since 4.2 */ protected void getNodeString(StringBuffer str) { str.append(getClassName()); str.append("("); //$NON-NLS-1$ str.append(getID()); str.append(") [");//$NON-NLS-1$ if(isDependent()) { str.append("Dependent] [");//$NON-NLS-1$ } str.append(this.joinStrategy.toString()); str.append("] [");//$NON-NLS-1$ str.append(this.joinType.toString()); str.append("]"); //$NON-NLS-1$ if (getJoinType() != JoinType.JOIN_CROSS) { str.append(" criteria=").append(getCriteriaList()); //$NON-NLS-1$ } str.append(" output="); //$NON-NLS-1$ str.append(getElements()); }
/** * @see org.teiid.query.processor.relational.RelationalNode#getNodeString(java.lang.StringBuffer) * @since 4.2 */ protected void getNodeString(StringBuffer str) { str.append(getClassName()); str.append("("); //$NON-NLS-1$ str.append(getID()); str.append(") [");//$NON-NLS-1$ if(isDependent()) { str.append("Dependent] [");//$NON-NLS-1$ } str.append(this.joinStrategy.toString()); str.append("] [");//$NON-NLS-1$ str.append(this.joinType.toString()); str.append("]"); //$NON-NLS-1$ if (getJoinType() != JoinType.JOIN_CROSS) { str.append(" criteria=").append(getCriteriaList()); //$NON-NLS-1$ } str.append(" output="); //$NON-NLS-1$ str.append(getElements()); }
private void outerMatch() { List<?> tuple = currentTuple; currentTuple = null; if (!matched && joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { this.joinNode.addBatchRow(outputTuple(tuple, this.rightSource.getOuterVals())); } }
@Override protected void loadRight() throws TeiidComponentException, TeiidProcessingException { if (this.joinNode.getJoinType() != JoinType.JOIN_FULL_OUTER || this.joinNode.getJoinCriteria() == null) { this.rightSource.setImplicitBuffer(ImplicitBuffer.ON_MARK); } this.rightSource.sort(this.processingSortRight); }
private void outerMatch() { List<?> tuple = currentTuple; currentTuple = null; if (!matched && joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { this.joinNode.addBatchRow(outputTuple(tuple, this.rightSource.getOuterVals())); } }
private void outerMatch() { List<?> tuple = currentTuple; currentTuple = null; if (!matched && joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { this.joinNode.addBatchRow(outputTuple(tuple, this.rightSource.getOuterVals())); } }
@Override protected void loadRight() throws TeiidComponentException, TeiidProcessingException { if (this.joinNode.getJoinType() != JoinType.JOIN_FULL_OUTER || this.joinNode.getJoinCriteria() == null) { this.rightSource.setImplicitBuffer(ImplicitBuffer.ON_MARK); } this.rightSource.sort(this.processingSortRight); }
@Override protected void loadRight() throws TeiidComponentException, TeiidProcessingException { if (this.joinNode.getJoinType() != JoinType.JOIN_FULL_OUTER || this.joinNode.getJoinCriteria() == null) { this.rightSource.setImplicitBuffer(ImplicitBuffer.ON_MARK); } this.rightSource.sort(this.processingSortRight); }
if (!outerMatched && this.joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { joinNode.addBatchRow(outputTuple(this.leftSource.getCurrentTuple(), this.rightSource.getOuterVals()));
if (!outerMatched && this.joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { joinNode.addBatchRow(outputTuple(this.leftSource.getCurrentTuple(), this.rightSource.getOuterVals()));
if (!outerMatched && this.joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { joinNode.addBatchRow(outputTuple(this.leftSource.getCurrentTuple(), this.rightSource.getOuterVals()));
if(nodeType.equals(JoinNode.class)) { JoinStrategy strategy = ((JoinNode)relationalNode).getJoinStrategy(); if (((JoinNode)relationalNode).getJoinType().equals(JoinType.JOIN_SEMI)) { updateCounts(SemiJoin.class, counts, types); } else if (((JoinNode)relationalNode).getJoinType().equals(JoinType.JOIN_ANTI_SEMI)) { updateCounts(AntiSemiJoin.class, counts, types);
return; if (this.sortedSource.getRowCount() == 0 && joinNode.getJoinType() != JoinType.JOIN_LEFT_OUTER) { return; if (this.sortedSource.getRowCount() == 0 && joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { outerMatch(); continue;
return; if (this.sortedSource.getRowCount() == 0 && joinNode.getJoinType() != JoinType.JOIN_LEFT_OUTER) { return; if (this.sortedSource.getRowCount() == 0 && joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { outerMatch(); continue;
@Test public void testOuterJoinRemoval() throws Exception { BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities(); caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, false); caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, false); ProcessorPlan plan = TestOptimizer.helpPlan("SELECT * from pm1.g1 inner join (pm1.g2 left outer join pm1.g3 on pm1.g2.e1=pm1.g3.e1) on pm1.g1.e1=pm1.g3.e1", //$NON-NLS-1$ RealMetadataFactory.example1Cached(), new String[] { "SELECT g_0.e1 AS c_0, g_0.e2 AS c_1, g_0.e3 AS c_2, g_0.e4 AS c_3 FROM pm1.g2 AS g_0 ORDER BY c_0", "SELECT g_0.e1 AS c_0, g_0.e2 AS c_1, g_0.e3 AS c_2, g_0.e4 AS c_3 FROM pm1.g1 AS g_0 ORDER BY c_0", "SELECT g_0.e1 AS c_0, g_0.e2 AS c_1, g_0.e3 AS c_2, g_0.e4 AS c_3 FROM pm1.g3 AS g_0 ORDER BY c_0"}, new DefaultCapabilitiesFinder(caps), ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ RelationalNode node = ((RelationalPlan)plan).getRootNode().getChildren()[0]; assertTrue(node instanceof JoinNode); node = node.getChildren()[0]; assertTrue(node instanceof JoinNode); assertEquals(JoinType.JOIN_INNER, ((JoinNode)node).getJoinType()); }
if (getJoinType() != JoinType.JOIN_FULL_OUTER && this.joinStrategy.leftSource.getSortUtility() == null && this.joinStrategy.leftSource.rowCountLE(0)) { this.terminateBatches(); return pullBatch(); if (getJoinType() != JoinType.JOIN_FULL_OUTER && this.joinStrategy.leftSource.getSortUtility() == null && this.joinStrategy.leftSource.rowCountLE(0)) { this.terminateBatches(); return pullBatch();
if (getJoinType() != JoinType.JOIN_FULL_OUTER && this.joinStrategy.leftSource.getSortUtility() == null && this.joinStrategy.leftSource.rowCountLE(0)) { this.terminateBatches(); return pullBatch(); if (getJoinType() != JoinType.JOIN_FULL_OUTER && this.joinStrategy.leftSource.getSortUtility() == null && this.joinStrategy.leftSource.rowCountLE(0)) { this.terminateBatches(); return pullBatch();
node = node.getChildren()[0]; assertTrue(node instanceof JoinNode); assertEquals(JoinType.JOIN_LEFT_OUTER, ((JoinNode)node).getJoinType());
if (joinNode.getJoinType() == JoinType.JOIN_LEFT_OUTER) { return false; //repeated is not supported as it could produce multiple outer matches