use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class H2ExplainQueryTest method testLeftJoin.
@Test
public void testLeftJoin() throws Exception {
Query query = TestQuery.LEFT_JOIN.getQuery();
String expectedQueryStr = "SELECT DISTINCT `example_VideoGame_player_XXX`.`name` AS `playerName` FROM `videoGames` AS `example_VideoGame`" + " LEFT OUTER JOIN `players` AS `example_VideoGame_player_XXX` ON `example_VideoGame`.`player_id`" + " = `example_VideoGame_player_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 H2ExplainQueryTest method testExplainWhereAnd.
@Test
public void testExplainWhereAnd() throws Exception {
Query query = TestQuery.WHERE_AND.getQuery();
String expectedQueryStr = "SELECT MAX(`example_PlayerStats`.`highScore`) AS `highScore`," + "`example_PlayerStats`.`overallRating` AS `overallRating` " + "FROM `playerStats` AS `example_PlayerStats` " + "LEFT OUTER JOIN `countries` AS `example_PlayerStats_country_XXX` " + "ON `example_PlayerStats`.`country_id` = `example_PlayerStats_country_XXX`.`id` " + "WHERE (`example_PlayerStats`.`overallRating` IS NOT NULL AND `example_PlayerStats_country_XXX`.`iso_code` IN (:XXX)) " + " GROUP BY `example_PlayerStats`.`overallRating`\n";
compareQueryLists(expectedQueryStr, engine.explain(query));
testQueryExecution(TestQuery.WHERE_AND.getQuery());
}
use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class H2ExplainQueryTest method testPaginationMetricsOnly.
@Test
public void testPaginationMetricsOnly() throws Exception {
// pagination query should be empty since there is no dimension projection
Query query = TestQuery.PAGINATION_METRIC_ONLY.getQuery();
String expectedQueryStr = "SELECT MIN(`example_PlayerStats`.`lowScore`) AS `lowScore` " + "FROM `playerStats` AS `example_PlayerStats` " + "LIMIT 5 OFFSET 10\n";
compareQueryLists(expectedQueryStr, engine.explain(query));
testQueryExecution(TestQuery.PAGINATION_METRIC_ONLY.getQuery());
}
use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class H2ExplainQueryTest method textExplainWhereOr.
@Test
public void textExplainWhereOr() throws Exception {
Query query = TestQuery.WHERE_OR.getQuery();
String expectedQueryStr = "SELECT MAX(`example_PlayerStats`.`highScore`) AS `highScore`," + "`example_PlayerStats`.`overallRating` AS `overallRating` " + "FROM `playerStats` AS `example_PlayerStats` " + "LEFT OUTER JOIN `countries` AS `example_PlayerStats_country_XXX` " + "ON `example_PlayerStats`.`country_id` = `example_PlayerStats_country_XXX`.`id` " + "WHERE (`example_PlayerStats`.`overallRating` IS NOT NULL OR `example_PlayerStats_country_XXX`.`iso_code` IN (:XXX)) " + " GROUP BY `example_PlayerStats`.`overallRating`\n";
compareQueryLists(expectedQueryStr, engine.explain(query));
testQueryExecution(TestQuery.WHERE_OR.getQuery());
}
use of com.yahoo.elide.datastores.aggregation.query.Query in project elide by yahoo.
the class HiveExplainQueryTest method testNestedMetricWithHavingQuery.
@Test
public void testNestedMetricWithHavingQuery() {
Query query = TestQuery.NESTED_METRIC_WITH_HAVING_QUERY.getQuery();
String exptectedQueryStr = getExpectedNestedMetricWithHavingQuery();
List<String> expectedQueryList = new ArrayList<>();
expectedQueryList.add(exptectedQueryStr);
compareQueryLists(expectedQueryList, engine.explain(query));
}
Aggregations