use of io.crate.metadata.doc.TestingDocTableInfoFactory 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();
}
use of io.crate.metadata.doc.TestingDocTableInfoFactory in project crate by crate.
the class SysShardsExpressionsTest method prepare.
@Before
public void prepare() throws Exception {
ClusterService clusterService = new NoopClusterService();
indexShard = mockIndexShard();
schemas = new Schemas(Settings.EMPTY, ImmutableMap.of("sys", new SysSchemaInfo(clusterService)), clusterService, new DocSchemaInfoFactory(new TestingDocTableInfoFactory(Collections.emptyMap())));
ShardReferenceResolver shardRefResolver = new ShardReferenceResolver(clusterService, schemas, indexShard);
resolver = new RecoveryShardReferenceResolver(shardRefResolver, indexShard);
}
use of io.crate.metadata.doc.TestingDocTableInfoFactory in project crate by crate.
the class SysShardsExpressionsTest method prepare.
@Before
public void prepare() {
NodeContext nodeCtx = createNodeContext();
indexShard = mockIndexShard();
CrateSettings crateSettings = new CrateSettings(clusterService, clusterService.getSettings());
UserDefinedFunctionService udfService = new UserDefinedFunctionService(clusterService, nodeCtx);
schemas = new Schemas(Map.of("sys", new SysSchemaInfo(this.clusterService, crateSettings)), clusterService, new DocSchemaInfoFactory(new TestingDocTableInfoFactory(Collections.emptyMap()), (ident, state) -> null, nodeCtx, udfService));
resolver = new ShardReferenceResolver(schemas, new ShardRowContext(indexShard, clusterService));
sysShards = schemas.getTableInfo(SysShardsTableInfo.IDENT);
}
Aggregations