Search in sources :

Example 31 with StreamingAggregate

use of org.apache.drill.exec.physical.config.StreamingAggregate in project drill by apache.

the class BasicPhysicalOpUnitTest method testSimpleStreamAgg.

@Test
public void testSimpleStreamAgg() {
    StreamingAggregate aggConf = new StreamingAggregate(null, parseExprs("a", "a"), parseExprs("sum(b)", "b_sum"));
    List<String> inputJsonBatches = Lists.newArrayList("[{\"a\": 5, \"b\" : 1 }]", "[{\"a\": 5, \"b\" : 5},{\"a\": 3, \"b\" : 8}]");
    legacyOpTestBuilder().physicalOperator(aggConf).inputDataStreamJson(inputJsonBatches).baselineColumns("b_sum", "a").baselineValues(6l, 5l).baselineValues(8l, 3l).go();
}
Also used : StreamingAggregate(org.apache.drill.exec.physical.config.StreamingAggregate) Test(org.junit.Test)

Aggregations

StreamingAggregate (org.apache.drill.exec.physical.config.StreamingAggregate)31 Test (org.junit.Test)29 OperatorTest (org.apache.drill.categories.OperatorTest)25 MockRecordBatch (org.apache.drill.exec.physical.impl.MockRecordBatch)25 StreamingAggBatch (org.apache.drill.exec.physical.impl.aggregate.StreamingAggBatch)25 DirectRowSet (org.apache.drill.exec.physical.rowSet.DirectRowSet)21 RowSet (org.apache.drill.exec.physical.rowSet.RowSet)21 RowSetComparison (org.apache.drill.test.rowSet.RowSetComparison)19 NamedExpression (org.apache.drill.common.logical.data.NamedExpression)7 SchemaBuilder (org.apache.drill.exec.record.metadata.SchemaBuilder)4 TupleMetadata (org.apache.drill.exec.record.metadata.TupleMetadata)4 PhysicalOperator (org.apache.drill.exec.physical.base.PhysicalOperator)2