private void declineSort() { RelationalNode parent = this.getParent(); RelationalNode child = this; while (parent != null && !(parent instanceof JoinNode)) { child = parent; if (parent instanceof SortNode) { return; } parent = parent.getParent(); } if (parent != null) { JoinNode joinNode = (JoinNode)parent; if (joinNode.getJoinStrategy() instanceof MergeJoinStrategy) { MergeJoinStrategy mjs = (MergeJoinStrategy)joinNode.getJoinStrategy(); if (joinNode.getChildren()[0] == child) { mjs.setProcessingSortLeft(true); } else { mjs.setProcessingSortRight(true); } } } sort = false; }
private void declineSort() { RelationalNode parent = this.getParent(); RelationalNode child = this; while (parent != null && !(parent instanceof JoinNode)) { child = parent; parent = parent.getParent(); } if (parent != null) { JoinNode joinNode = (JoinNode)parent; if (joinNode.getJoinStrategy() instanceof MergeJoinStrategy) { MergeJoinStrategy mjs = (MergeJoinStrategy)joinNode.getJoinStrategy(); if (joinNode.getChildren()[0] == child) { mjs.setProcessingSortLeft(true); } else { mjs.setProcessingSortRight(true); } } } sort = false; }
private void declineSort() { RelationalNode parent = this.getParent(); RelationalNode child = this; while (parent != null && !(parent instanceof JoinNode)) { child = parent; if (parent instanceof SortNode) { return; } parent = parent.getParent(); } if (parent != null) { JoinNode joinNode = (JoinNode)parent; if (joinNode.getJoinStrategy() instanceof MergeJoinStrategy) { MergeJoinStrategy mjs = (MergeJoinStrategy)joinNode.getJoinStrategy(); if (joinNode.getChildren()[0] == child) { mjs.setProcessingSortLeft(true); } else { mjs.setProcessingSortRight(true); } } } sort = false; }
@Test public void testTextTableJoin() throws Exception { String sql = "select z.* from (select x.* from (select * from pm1.g1 where e1 = 'c') y, texttable(e1 || '\n' || e2 || '\n' || e3 COLUMNS x string) x) as z, " + "(select x.* from (select * from pm1.g1 where e1 = 'c') y, texttable(e1 || '\n' || e2 || '\n' || e3 COLUMNS x string) x) as z1 where z.x = z1.x"; List<?>[] expected = new List<?>[] { Arrays.asList("c"), Arrays.asList("1"), Arrays.asList("true"), }; FakeDataManager dataManager = new FakeDataManager(); sampleData1(dataManager); RelationalPlan plan = (RelationalPlan)helpGetPlan(helpParse(sql), RealMetadataFactory.example1Cached()); JoinNode join = (JoinNode) plan.getRootNode().getChildren()[0]; assertTrue(!(join.getJoinStrategy() instanceof NestedTableJoinStrategy)); helpProcess(plan, createCommandContext(), dataManager, expected); }
Class<?> nodeType = relationalNode.getClass(); if(nodeType.equals(JoinNode.class)) { JoinStrategy strategy = ((JoinNode)relationalNode).getJoinStrategy(); if (((JoinNode)relationalNode).getJoinType().equals(JoinType.JOIN_SEMI)) { updateCounts(SemiJoin.class, counts, types);