Search in sources :

Example 11 with Functions

use of io.crate.metadata.Functions in project crate by crate.

the class S3FileReadingCollectorTest method prepare.

@Before
public void prepare() throws Exception {
    NodeContext nodeCtx = new NodeContext(new Functions(Map.of()));
    inputFactory = new InputFactory(nodeCtx);
}
Also used : FileInputFactory(io.crate.execution.engine.collect.files.FileInputFactory) InputFactory(io.crate.expression.InputFactory) NodeContext(io.crate.metadata.NodeContext) Functions(io.crate.metadata.Functions) Before(org.junit.Before)

Example 12 with Functions

use of io.crate.metadata.Functions in project crate by crate.

the class FileReadingCollectorTest method prepare.

@Before
public void prepare() throws Exception {
    NodeContext nodeCtx = new NodeContext(new Functions(Map.of()));
    inputFactory = new InputFactory(nodeCtx);
}
Also used : InputFactory(io.crate.expression.InputFactory) NodeContext(io.crate.metadata.NodeContext) Functions(io.crate.metadata.Functions) Before(org.junit.Before)

Example 13 with Functions

use of io.crate.metadata.Functions in project crate by crate.

the class FileReadingIteratorTest method prepare.

@Before
public void prepare() {
    NodeContext nodeCtx = new NodeContext(new Functions(Map.of()));
    inputFactory = new InputFactory(nodeCtx);
}
Also used : InputFactory(io.crate.expression.InputFactory) NodeContext(io.crate.metadata.NodeContext) Functions(io.crate.metadata.Functions) Before(org.junit.Before)

Example 14 with Functions

use of io.crate.metadata.Functions in project crate by crate.

the class GroupingIntegerCollectorBenchmark method createGroupingCollector.

@Setup
public void createGroupingCollector() {
    Functions functions = new ModulesBuilder().add(new AggregationImplModule()).createInjector().getInstance(Functions.class);
    groupBySumCollector = createGroupBySumCollector(functions);
    rows = new ArrayList<>(20_000_000);
    for (int i = 0; i < 20_000_000; i++) {
        rows.add(new Row1(i % 200));
    }
}
Also used : Functions(io.crate.metadata.Functions) ModulesBuilder(org.elasticsearch.common.inject.ModulesBuilder) AggregationImplModule(io.crate.operation.aggregation.impl.AggregationImplModule)

Example 15 with Functions

use of io.crate.metadata.Functions in project crate by crate.

the class AggregatorTest method setUpFunctions.

@Before
public void setUpFunctions() {
    Functions functions = getFunctions();
    FunctionIdent countAggIdent = new FunctionIdent(CountAggregation.NAME, Arrays.<DataType>asList(DataTypes.STRING));
    countImpl = (AggregationFunction) functions.get(countAggIdent);
}
Also used : FunctionIdent(io.crate.metadata.FunctionIdent) TestingHelpers.getFunctions(io.crate.testing.TestingHelpers.getFunctions) Functions(io.crate.metadata.Functions) Before(org.junit.Before)

Aggregations

Functions (io.crate.metadata.Functions)19 ModulesBuilder (org.elasticsearch.common.inject.ModulesBuilder)7 NodeContext (io.crate.metadata.NodeContext)6 Before (org.junit.Before)6 Setup (org.openjdk.jmh.annotations.Setup)6 InputFactory (io.crate.expression.InputFactory)5 Row (io.crate.data.Row)4 OnHeapMemoryManager (io.crate.memory.OnHeapMemoryManager)4 SessionContext (io.crate.action.sql.SessionContext)3 Input (io.crate.data.Input)3 Row1 (io.crate.data.Row1)3 AggregationImplModule (io.crate.execution.engine.aggregation.impl.AggregationImplModule)3 InputCollectExpression (io.crate.execution.engine.collect.InputCollectExpression)3 Literal (io.crate.expression.symbol.Literal)3 List (java.util.List)3 RamAccounting (io.crate.breaker.RamAccounting)2 LocalFsFileInputFactory (io.crate.execution.engine.collect.files.LocalFsFileInputFactory)2 AggregateMode (io.crate.expression.symbol.AggregateMode)2 ColumnIdent (io.crate.metadata.ColumnIdent)2 Signature (io.crate.metadata.functions.Signature)2