use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlMerticTagsTest method testDoubleTagFiltersOr.
@Issue("4180")
@Test(dataProvider = "provideDoubleOperatorsOr", description = "Test all filters connected with complex filter equals to OR. (A OR B) AND (A OR B) = A OR B." + "Each filter will be tested with all other filters in his group, i.e. cross-product." + "Expected result is a union of first and second filter expected tags")
public void testDoubleTagFiltersOr(Filter filter) {
String sqlQuery = String.format("SELECT tags.tag FROM \"%1$s\" WHERE (%2$s) AND (%2$s)", TEST_METRICS[0], filter.getExpression());
StringTable table = queryTable(sqlQuery);
assertEquals(String.format("Wrong query result using double tag filters: %s", filter.getExpression()), Sets.newHashSet(table.columnValues("tags.tag")), filter.getExpectedResultSet());
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlMerticTagsTest method testDoubleTagFiltersAtsdSeriesAnd.
@Issue("4180")
@Test(dataProvider = "provideDoubleOperatorsAnd", description = "Test all filters select from atsd_series connected with complex filter equals to AND. " + "(A AND B) OR (A AND B) = A AND B." + "Each filter will be tested with all other filters in his group, i.e. cross-product." + "Expected result is a intersection of first and second filter expected tags")
public void testDoubleTagFiltersAtsdSeriesAnd(Filter filter) {
// Logically similar to A AND B
String sqlQuery = String.format("SELECT tags.tag " + "FROM atsd_series " + "WHERE metric IN ('%1$s', '%2$s') AND ((%3$s) OR (%3$s)) " + "ORDER BY tags.tag", TEST_METRICS[0], TEST_METRICS[1], filter.getExpression());
StringTable table = queryTable(sqlQuery);
assertEquals(String.format("Wrong atsd_series query result using double tag filters: %s", filter.getExpression()), Sets.newHashSet(table.columnValues("tags.tag")), filter.getExpectedResultSet());
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlMerticTagsTest method testSingleTagFilter.
@Issue("4180")
@Test(dataProvider = "provideAllSingleOperators", description = "Test single tag filter")
public void testSingleTagFilter(Filter<String> filter) {
String sqlQuery = String.format("SELECT tags.tag FROM \"%s\" WHERE %s ORDER BY tags.tag", TEST_METRICS[0], filter.getExpression());
StringTable table = queryTable(sqlQuery);
assertEquals(String.format("Wrong query result using single tag filter: %s", filter), Sets.newHashSet(table.columnValues("tags.tag")), filter.getExpectedResultSet());
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlMerticTagsTest method testDoubleTagFiltersAtsdSeriesOr.
@Issue("4180")
@Test(dataProvider = "provideDoubleOperatorsOr", description = "Test all filters select from atsd_series connected with complex filter equals to OR. " + "(A OR B) AND (A OR B) = A OR B." + "Each filter will be tested with all other filters in his group, i.e. cross-product." + "Expected result is a union of first and second filter expected tags")
public void testDoubleTagFiltersAtsdSeriesOr(Filter filter) {
// Logically similar to A OR B
String sqlQuery = String.format("SELECT tags.tag " + "FROM atsd_series " + "WHERE metric IN ('%1$s', '%2$s') AND ((%3$s) AND (%3$s)) " + "ORDER BY tags.tag", TEST_METRICS[0], TEST_METRICS[1], filter.getExpression());
StringTable table = queryTable(sqlQuery);
assertEquals(String.format("Wrong atsd_series query result using double tag filters: %s", filter.getExpression()), Sets.newHashSet(table.columnValues("tags.tag")), filter.getExpectedResultSet());
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlSelectMetricTagsTest method testSelectMetricSpecifiedTag.
@Issue("3056")
@Test
public void testSelectMetricSpecifiedTag() {
String sqlQuery = String.format("SELECT metric.tags.a %nFROM \"%s\" %nWHERE datetime = '2016-06-29T08:00:00.000Z'AND entity='%s'", TEST_METRIC_NAME, TEST_ENTITY_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
assertTableColumnsNames(Collections.singletonList("metric.tags.a"), resultTable);
List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("b"));
assertTableRowsExist(expectedRows, resultTable);
}
Aggregations