Search in sources :

Example 1 with SelectAnalyzedStatement

use of io.crate.analyze.SelectAnalyzedStatement in project crate by crate.

the class SubqueryPlanner method planSubquery.

private void planSubquery(SelectSymbol selectSymbol) {
    AnalyzedRelation relation = selectSymbol.relation();
    SelectAnalyzedStatement selectAnalyzedStatement = new SelectAnalyzedStatement(((QueriedRelation) relation));
    Plan subPlan = plannerContext.planSingleRowSubselect(selectAnalyzedStatement);
    subQueries.put(subPlan, selectSymbol);
}
Also used : QueriedRelation(io.crate.analyze.relations.QueriedRelation) AnalyzedRelation(io.crate.analyze.relations.AnalyzedRelation) SelectAnalyzedStatement(io.crate.analyze.SelectAnalyzedStatement)

Example 2 with SelectAnalyzedStatement

use of io.crate.analyze.SelectAnalyzedStatement in project crate by crate.

the class RelationAnalyzerTest method testColumnNameFromArrayComparisonExpression.

@Test
public void testColumnNameFromArrayComparisonExpression() throws Exception {
    SelectAnalyzedStatement statement = executor.analyze("select 'foo' = any(constraint_name) " + "from information_schema.table_constraints");
    assertThat(statement.relation().fields().get(0).path().outputName(), is("'foo' = ANY(constraint_name)"));
}
Also used : SelectAnalyzedStatement(io.crate.analyze.SelectAnalyzedStatement) Test(org.junit.Test) CrateUnitTest(io.crate.test.integration.CrateUnitTest)

Example 3 with SelectAnalyzedStatement

use of io.crate.analyze.SelectAnalyzedStatement in project crate by crate.

the class MultiSourceFetchPushDownTest method pushDown.

private void pushDown(String stmt) {
    SelectAnalyzedStatement a = e.analyze(stmt);
    assertThat(a.relation(), instanceOf(MultiSourceSelect.class));
    mss = (MultiSourceSelect) a.relation();
    pd = new MultiSourceFetchPushDown(mss);
    pd.process();
}
Also used : MultiSourceSelect(io.crate.analyze.MultiSourceSelect) SelectAnalyzedStatement(io.crate.analyze.SelectAnalyzedStatement)

Aggregations

SelectAnalyzedStatement (io.crate.analyze.SelectAnalyzedStatement)3 MultiSourceSelect (io.crate.analyze.MultiSourceSelect)1 AnalyzedRelation (io.crate.analyze.relations.AnalyzedRelation)1 QueriedRelation (io.crate.analyze.relations.QueriedRelation)1 CrateUnitTest (io.crate.test.integration.CrateUnitTest)1 Test (org.junit.Test)1