Search in sources :

Example 51 with ArrayType

use of io.crate.types.ArrayType in project crate by crate.

the class PercentileAggregationTest method testReturnTypes.

@Test
public void testReturnTypes() throws Exception {
    FunctionIdent synopsis1 = new FunctionIdent(NAME, ImmutableList.<DataType>of(DataTypes.DOUBLE, DataTypes.DOUBLE));
    assertEquals(DataTypes.DOUBLE, functions.get(synopsis1).info().returnType());
    FunctionIdent synopsis2 = new FunctionIdent(NAME, ImmutableList.<DataType>of(DataTypes.DOUBLE, new ArrayType(DataTypes.DOUBLE)));
    assertEquals(new ArrayType(DataTypes.DOUBLE), functions.get(synopsis2).info().returnType());
}
Also used : ArrayType(io.crate.types.ArrayType) FunctionIdent(io.crate.metadata.FunctionIdent) Test(org.junit.Test) AggregationTest(io.crate.operation.aggregation.AggregationTest)

Aggregations

ArrayType (io.crate.types.ArrayType)51 Test (org.junit.Test)36 CrateUnitTest (io.crate.test.integration.CrateUnitTest)35 DataType (io.crate.types.DataType)30 BytesRef (org.apache.lucene.util.BytesRef)9 Literal (io.crate.analyze.symbol.Literal)6 DocTableInfo (io.crate.metadata.doc.DocTableInfo)5 WhereClause (io.crate.analyze.WhereClause)4 Function (io.crate.analyze.symbol.Function)4 Input (io.crate.data.Input)4 TransactionContext (io.crate.metadata.TransactionContext)4 ColumnIdent (io.crate.metadata.ColumnIdent)3 QualifiedName (io.crate.sql.tree.QualifiedName)3 SqlExpressions (io.crate.testing.SqlExpressions)3 Before (org.junit.Before)3 TableRelation (io.crate.analyze.relations.TableRelation)2 FunctionImplementation (io.crate.metadata.FunctionImplementation)2 TableIdent (io.crate.metadata.TableIdent)2 NotPredicate (io.crate.operation.predicate.NotPredicate)2 HashMap (java.util.HashMap)2