Search in sources :

Example 56 with SQLTable

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable in project elide by yahoo.

the class SQLColumnProjectionTest method testPhysicalColumnThatCanNest.

@Test
public void testPhysicalColumnThatCanNest() throws Exception {
    SQLTable table = metaDataStore.getTable(ClassType.of(TableB.class));
    ColumnProjection projection = table.getColumnProjection("dim1");
    assertTrue(projection.canNest(table, metaDataStore));
}
Also used : SQLTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable) ColumnProjection(com.yahoo.elide.datastores.aggregation.query.ColumnProjection) Test(org.junit.jupiter.api.Test)

Example 57 with SQLTable

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable in project elide by yahoo.

the class SQLColumnProjectionTest method testColumnArgsColumnThatCanNest.

@Test
public void testColumnArgsColumnThatCanNest() throws Exception {
    SQLTable table = metaDataStore.getTable(ClassType.of(TableA.class));
    Map<String, Argument> args = new HashMap<>();
    args.put("foo", Argument.builder().name("foo").value("bar").build());
    ColumnProjection projection = table.getColumnProjection("dim2", args);
    assertTrue(projection.canNest(table, metaDataStore));
}
Also used : Argument(com.yahoo.elide.core.request.Argument) HashMap(java.util.HashMap) SQLTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable) ColumnProjection(com.yahoo.elide.datastores.aggregation.query.ColumnProjection) Test(org.junit.jupiter.api.Test)

Example 58 with SQLTable

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable in project elide by yahoo.

the class HasColumnArgsVisitorTest method testPhysicalColumn.

@Test
public void testPhysicalColumn() throws Exception {
    SQLTable table = metaDataStore.getTable(ClassType.of(TableB.class));
    ColumnProjection projection = table.getColumnProjection("physical");
    assertFalse(matches(table, projection));
}
Also used : SQLTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable) ColumnProjection(com.yahoo.elide.datastores.aggregation.query.ColumnProjection) Test(org.junit.jupiter.api.Test)

Example 59 with SQLTable

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable in project elide by yahoo.

the class HasColumnArgsVisitorTest method testJoinWithColumnArgs.

@Test
public void testJoinWithColumnArgs() throws Exception {
    SQLTable table = metaDataStore.getTable(ClassType.of(TableA.class));
    ColumnProjection projection = table.getColumnProjection("joinWithColumnArgsToPhysical");
    assertTrue(matches(table, projection));
}
Also used : SQLTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable) ColumnProjection(com.yahoo.elide.datastores.aggregation.query.ColumnProjection) Test(org.junit.jupiter.api.Test)

Example 60 with SQLTable

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable in project elide by yahoo.

the class HasColumnArgsVisitorTest method testColumnArgs.

@Test
public void testColumnArgs() throws Exception {
    SQLTable table = metaDataStore.getTable(ClassType.of(TableC.class));
    ColumnProjection projection = table.getColumnProjection("columnArgs");
    assertTrue(matches(table, projection));
}
Also used : SQLTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable) ColumnProjection(com.yahoo.elide.datastores.aggregation.query.ColumnProjection) Test(org.junit.jupiter.api.Test)

Aggregations

SQLTable (com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable)76 Test (org.junit.jupiter.api.Test)59 Query (com.yahoo.elide.datastores.aggregation.query.Query)50 SQLUnitTest (com.yahoo.elide.datastores.aggregation.framework.SQLUnitTest)49 FilterExpression (com.yahoo.elide.core.filter.expression.FilterExpression)34 Path (com.yahoo.elide.core.Path)31 FilterPredicate (com.yahoo.elide.core.filter.predicates.FilterPredicate)31 AndFilterExpression (com.yahoo.elide.core.filter.expression.AndFilterExpression)29 OrFilterExpression (com.yahoo.elide.core.filter.expression.OrFilterExpression)29 Argument (com.yahoo.elide.core.request.Argument)24 Day (com.yahoo.elide.datastores.aggregation.timegrains.Day)20 Date (java.util.Date)19 GameRevenue (example.GameRevenue)15 ColumnProjection (com.yahoo.elide.datastores.aggregation.query.ColumnProjection)12 HashSet (java.util.HashSet)12 SortingImpl (com.yahoo.elide.core.sort.SortingImpl)8 Namespace (com.yahoo.elide.datastores.aggregation.metadata.models.Namespace)8 HashMap (java.util.HashMap)8 TreeMap (java.util.TreeMap)8 EntityDictionary (com.yahoo.elide.core.dictionary.EntityDictionary)7