Search in sources :

Example 1 with DocTableInfoFactory

use of io.crate.metadata.doc.DocTableInfoFactory in project crate by crate.

the class SelectStatementAnalyzerTest method init.

@Before
public void init() throws Exception {
    DocTableInfo fooUserTableInfo = TestingTableInfo.builder(new TableIdent("foo", "users"), SHARD_ROUTING).add("id", DataTypes.LONG, null).add("name", DataTypes.STRING, null).addPrimaryKey("id").build();
    DocTableInfoFactory fooTableFactory = new TestingDocTableInfoFactory(ImmutableMap.of(fooUserTableInfo.ident(), fooUserTableInfo));
    ClusterService clusterService = new NoopClusterService();
    sqlExecutor = SQLExecutor.builder(clusterService).enableDefaultTables().addSchema(new DocSchemaInfo("foo", clusterService, fooTableFactory)).build();
}
Also used : DocTableInfo(io.crate.metadata.doc.DocTableInfo) DocSchemaInfo(io.crate.metadata.doc.DocSchemaInfo) NoopClusterService(org.elasticsearch.test.cluster.NoopClusterService) ClusterService(org.elasticsearch.cluster.ClusterService) TestingDocTableInfoFactory(io.crate.metadata.doc.TestingDocTableInfoFactory) TableIdent(io.crate.metadata.TableIdent) NoopClusterService(org.elasticsearch.test.cluster.NoopClusterService) DocTableInfoFactory(io.crate.metadata.doc.DocTableInfoFactory) TestingDocTableInfoFactory(io.crate.metadata.doc.TestingDocTableInfoFactory) Before(org.junit.Before)

Aggregations

TableIdent (io.crate.metadata.TableIdent)1 DocSchemaInfo (io.crate.metadata.doc.DocSchemaInfo)1 DocTableInfo (io.crate.metadata.doc.DocTableInfo)1 DocTableInfoFactory (io.crate.metadata.doc.DocTableInfoFactory)1 TestingDocTableInfoFactory (io.crate.metadata.doc.TestingDocTableInfoFactory)1 ClusterService (org.elasticsearch.cluster.ClusterService)1 NoopClusterService (org.elasticsearch.test.cluster.NoopClusterService)1 Before (org.junit.Before)1