use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class SkipOptimizerTest method testNegatingOptimizer.
@Test
public void testNegatingOptimizer() {
when(optimizer.hint()).thenReturn("JoinBeforeAggregate");
when(optimizer.negateHint()).thenReturn("NoJoinBeforeAggregate");
Query query = TestQuery.WHERE_AND.getQuery();
engine.explain(query);
verify(optimizer, never()).optimize(any());
}
use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class PostgresExplainQueryTest method testExplainHavingMetricsAndDims.
@Test
public void testExplainHavingMetricsAndDims() throws Exception {
Query query = TestQuery.HAVING_METRICS_AND_DIMS.getQuery();
String expectedQueryStr = "SELECT MAX(\"example_PlayerStats\".\"highScore\") AS \"highScore\"," + "\"example_PlayerStats\".\"overallRating\" AS \"overallRating\" " + "FROM \"playerStats\" AS \"example_PlayerStats\" " + "GROUP BY \"example_PlayerStats\".\"overallRating\" " + "HAVING (\"example_PlayerStats\".\"overallRating\" IS NOT NULL " + "AND MAX(\"example_PlayerStats\".\"highScore\") > :XXX)";
compareQueryLists(expectedQueryStr, engine.explain(query));
testQueryExecution(TestQuery.HAVING_METRICS_AND_DIMS.getQuery());
}
use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class PrestoDBExplainQueryTest method testJoinWithMetrics.
@Test
public void testJoinWithMetrics() throws Exception {
Query query = TestQuery.METRIC_JOIN.getQuery();
String expectedQueryStr = "SELECT " + "MAX(\"example_VideoGame_playerStats_XXX\".\"highScore\") / SUM(\"example_VideoGame\".\"timeSpent\") AS \"normalizedHighScore\" " + "FROM \"videoGames\" AS \"example_VideoGame\" " + "LEFT OUTER JOIN \"playerStats\" AS \"example_VideoGame_playerStats_XXX\" " + "ON \"example_VideoGame\".\"player_id\" = \"example_VideoGame_playerStats_XXX\".\"id\"";
compareQueryLists(expectedQueryStr, engine.explain(query));
testQueryExecution(query);
}
use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class PrestoDBExplainQueryTest method testExplainHavingMetricsAndDims.
@Test
public void testExplainHavingMetricsAndDims() throws Exception {
Query query = TestQuery.HAVING_METRICS_AND_DIMS.getQuery();
String expectedQueryStr = "SELECT MAX(\"example_PlayerStats\".\"highScore\") AS \"highScore\"," + "\"example_PlayerStats\".\"overallRating\" AS \"overallRating\" " + "FROM \"playerStats\" AS \"example_PlayerStats\" " + "GROUP BY \"example_PlayerStats\".\"overallRating\" " + "HAVING (\"example_PlayerStats\".\"overallRating\" IS NOT NULL " + "AND MAX(\"example_PlayerStats\".\"highScore\") > :XXX)";
compareQueryLists(expectedQueryStr, engine.explain(query));
}
use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class PrestoDBExplainQueryTest method testInnerJoin.
@Test
public void testInnerJoin() throws Exception {
Query query = TestQuery.INNER_JOIN.getQuery();
String expectedQueryStr = "SELECT DISTINCT \"example_VideoGame_playerInnerJoin_XXX\".\"name\" AS \"playerNameInnerJoin\" FROM \"videoGames\" AS \"example_VideoGame\"" + " INNER JOIN \"players\" AS \"example_VideoGame_playerInnerJoin_XXX\" ON \"example_VideoGame\".\"player_id\"" + " = \"example_VideoGame_playerInnerJoin_XXX\".\"id\"";
compareQueryLists(expectedQueryStr, engine.explain(query));
}
Aggregations