use of io.crate.testing.IndexEnv in project crate by crate.
the class DocLevelExpressionsTest method prepare.
@Before
public void prepare() throws Exception {
SQLExecutor e = SQLExecutor.builder(clusterService).addTable(createTableStatement).build();
indexEnv = new IndexEnv(THREAD_POOL, (DocTableInfo) StreamSupport.stream(e.schemas().spliterator(), false).filter(x -> x instanceof DocSchemaInfo).map(x -> (DocSchemaInfo) x).findFirst().orElseThrow(() -> new IllegalStateException("No doc schema found")).getTables().iterator().next(), clusterService.state(), Version.CURRENT, createTempDir());
IndexWriter writer = indexEnv.writer();
insertValues(writer);
DirectoryReader directoryReader = DirectoryReader.open(writer, true, true);
readerContext = directoryReader.leaves().get(0);
ctx = new CollectorContext();
}
Aggregations