private void helpTestOpen(Command command, String expectedCommand, boolean shouldRegisterRequest) throws Exception { // Setup AccessNode node = new AccessNode(1); node.setCommand(command); CommandContext context = new CommandContext(); BufferManager bm = BufferManagerFactory.getStandaloneBufferManager(); FakeDataManager dataManager = new FakeDataManager(); TestProcessor.sampleData1(dataManager); node.setElements(command.getProjectedSymbols()); node.initialize(context, bm, dataManager); node.setShouldEvaluateExpressions(true); // Call open() node.open(); if (shouldRegisterRequest) { assertEquals(Arrays.asList(expectedCommand), dataManager.getQueries()); } else { assertEquals(0, dataManager.getQueries().size()); } }
@Test public void testExecCount()throws Exception{ // Setup AccessNode node = new AccessNode(1); Query query = (Query)TestResolver.helpResolve("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5", RealMetadataFactory.example1Cached()); //$NON-NLS-1$ node.setCommand(query); CommandContext context = new CommandContext(); BufferManager bm = BufferManagerFactory.getStandaloneBufferManager(); FakeDataManager dataManager = new FakeDataManager(); TestProcessor.sampleData1(dataManager); node.setElements(query.getProjectedSymbols()); node.initialize(context, bm, dataManager); // Call open() node.open(); assertEquals(Arrays.asList("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5"), dataManager.getQueries()); //$NON-NLS-1$ }
VDBMetaData vdb = context.getVdb(); aNode.setShouldEvaluateExpressions(true); //forces a rewrite aNode.setElements( (List) node.getProperty(NodeConstants.Info.OUTPUT_COLS) ); if (node.hasBooleanProperty(Info.IS_MULTI_SOURCE)) { Expression ex = rewriteMultiSourceCommand(aNode.getCommand());
VDBMetaData vdb = context.getVdb(); aNode.setShouldEvaluateExpressions(true); //forces a rewrite aNode.setElements( (List) node.getProperty(NodeConstants.Info.OUTPUT_COLS) ); if (node.hasBooleanProperty(Info.IS_MULTI_SOURCE)) { Expression ex = rewriteMultiSourceCommand(aNode.getCommand());
VDBMetaData vdb = context.getVdb(); aNode.setShouldEvaluateExpressions(true); //forces a rewrite aNode.setElements( (List) node.getProperty(NodeConstants.Info.OUTPUT_COLS) ); if (node.hasBooleanProperty(Info.IS_MULTI_SOURCE)) { Expression ex = rewriteMultiSourceCommand(aNode.getCommand());