public RuleStack clone() { RuleStack clone = new RuleStack(); clone.rules.addAll(this.rules); clone.planner = this.planner; return clone; }
public RuleStack clone() { RuleStack clone = new RuleStack(); clone.rules.addAll(this.rules); clone.planner = this.planner; return clone; }
public RuleStack clone() { RuleStack clone = new RuleStack(); clone.rules.addAll(this.rules); clone.planner = this.planner; return clone; }
public void testPopNothing() { RuleStack stack = new RuleStack(); helpTestPop(stack, null, 0); }
public void testPopOneRule() { RuleStack stack = new RuleStack(); int expectedSize = stack.size(); OptimizerRule rule = new RulePushSelectCriteria(); stack.push(rule); helpTestPop(stack, rule, expectedSize); }
public void testInitialization() { RuleStack stack = new RuleStack(); assertEquals("Initial stack is not empty", true, stack.isEmpty()); //$NON-NLS-1$ assertEquals("Initial size is not 0", 0, stack.size()); //$NON-NLS-1$ assertNull("Top is not null", stack.pop()); //$NON-NLS-1$ }
public void testContains() { // Set up RuleStack stack = new RuleStack(); stack.push(RuleConstants.ACCESS_PATTERN_VALIDATION); stack.push(RuleConstants.COLLAPSE_SOURCE); assertEquals(true, stack.contains(RuleConstants.ACCESS_PATTERN_VALIDATION)); assertEquals(false, stack.contains(RuleConstants.PLACE_ACCESS)); }
public void testRemove() { // Set up RuleStack stack = new RuleStack(); stack.push(RuleConstants.ACCESS_PATTERN_VALIDATION); stack.push(RuleConstants.COLLAPSE_SOURCE); stack.push(RuleConstants.ACCESS_PATTERN_VALIDATION); // Remove all instances of ASSIGN_OUTPUT_ELEMENTS stack.remove(RuleConstants.ACCESS_PATTERN_VALIDATION); // Verify size and pop'ed values assertEquals(1, stack.size()); assertEquals(RuleConstants.COLLAPSE_SOURCE, stack.pop()); assertEquals(null, stack.pop()); }
RuleStack stack = new RuleStack(); stack.push(new RuleAssignOutputElements(false)); if (hints.hasRowBasedSecurity) {
RuleStack stack = new RuleStack(); stack.push(new RuleAssignOutputElements(false)); if (hints.hasRowBasedSecurity) {
RuleStack stack = new RuleStack(); stack.push(new RuleAssignOutputElements(false)); if (hints.hasRowBasedSecurity) {
@Test public void testPushAcrossFrameWithAccessNode() throws Exception { QueryMetadataInterface metadata = new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()); Command command = TestOptimizer.helpGetCommand("select * from (select * from pm1.g1 union select * from pm1.g2) x where e1 = 1", metadata); //$NON-NLS-1$ Command subCommand = TestOptimizer.helpGetCommand("select * from pm1.g1 union select * from pm1.g2", metadata); //$NON-NLS-1$ RelationalPlanner p = new RelationalPlanner(); CommandContext cc = new CommandContext(); p.initialize(command, null, metadata, null, null, cc); PlanNode root = p.generatePlan(command); PlanNode child = p.generatePlan(subCommand); PlanNode sourceNode = NodeEditor.findNodePreOrder(root, NodeConstants.Types.SOURCE); sourceNode.addFirstChild(child); sourceNode.setProperty(NodeConstants.Info.SYMBOL_MAP, SymbolMap.createSymbolMap(sourceNode.getGroups().iterator().next(), (List<Expression>)child.getFirstChild().getProperty(Info.PROJECT_COLS), metadata)); //add a dummy access node PlanNode accessNode = NodeFactory.getNewNode(NodeConstants.Types.ACCESS); accessNode.addGroups(child.getFirstChild().getGroups()); child.getFirstChild().addAsParent(accessNode); new RulePushSelectCriteria().execute(root, metadata, new DefaultCapabilitiesFinder(), new RuleStack(), AnalysisRecord.createNonRecordingRecord(), cc); // the select node should still be above the access node accessNode = NodeEditor.findNodePreOrder(root, NodeConstants.Types.ACCESS); assertEquals(NodeConstants.Types.SELECT, accessNode.getParent().getType()); assertNull(NodeEditor.findNodePreOrder(accessNode, NodeConstants.Types.SELECT)); }
public RuleStack buildRules() { RuleStack rules = new RuleStack(); rules.setPlanner(this); rules.push(RuleConstants.COLLAPSE_SOURCE);
public RuleStack buildRules() { RuleStack rules = new RuleStack(); rules.setPlanner(this); rules.push(RuleConstants.COLLAPSE_SOURCE);
public RuleStack buildRules() { RuleStack rules = new RuleStack(); rules.setPlanner(this); rules.push(RuleConstants.COLLAPSE_SOURCE);
capFinder.addCapabilities("pm4", TestOptimizer.getTypicalCapabilities()); //$NON-NLS-1$ rule.execute(bogusParentNode, metadata, capFinder, new RuleStack(), null, new CommandContext());