Package io.crate.sql.tree

Examples of io.crate.sql.tree.Statement


        assertThat(md.columns().size(), is(2));
        assertThat(md.hasAutoGeneratedPrimaryKey(), is(true));
    }

    private DocIndexMetaData getDocIndexMetaDataFromStatement(String stmt) throws IOException {
        Statement statement = SqlParser.createStatement(stmt);
        ClusterService clusterService = mock(ClusterService.class);
        CreateTableStatementAnalyzer analyzer = new CreateTableStatementAnalyzer(
            new ReferenceInfos(
                ImmutableMap.<String, SchemaInfo>of("doc",
                    new DocSchemaInfo(clusterService,
View Full Code Here


    }

    @Test
    public void testGlobalAggregationPlan() throws Exception {
        String statementString = "select count(name) from users";
        Statement statement = SqlParser.createStatement(statementString);

        Analysis analysis = analyzer.analyze(statement);
        Plan plan = planner.plan(analysis);
        Iterator<PlanNode> iterator = plan.iterator();
View Full Code Here

        if (disabled) {
            sendResponse(listener, new NodeDisconnectedException(clusterService.localNode(), actionName));
            return;
        }
        try {
            Statement statement = statementCache.get(request.stmt());
            Analysis analysis = getAnalysis(statement, request);

            if (analysis.isData()) {
                processWithPlanner(analysis, request, listener);
            } else {
View Full Code Here

        // verify round-trip of formatting already-formatted SQL
        assertEquals(formatSql(createStatement(formatted)), formatted);

        // compare parsed tree with parsed tree of formatted SQL
        Statement actual = createStatement(formatted);
        if (!actual.equals(expected)) {
            // simplify finding the non-equal part of the tree
            assertListEquals(linearizeTree(actual), linearizeTree(expected));
        }
        assertEquals(actual, expected);
    }
View Full Code Here

TOP

Related Classes of io.crate.sql.tree.Statement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.