use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlClauseJoinValueOrderTest method testOrderAsc.
@Issue("3322")
@Test
public void testOrderAsc() {
String sqlQuery = String.format("SELECT t1.value FROM \"%s\" t1%nOUTER JOIN \"%s\" t2%nORDER BY t1.value", TEST_METRIC1_NAME, TEST_METRIC2_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
String[][] expectedRows = { { "null" }, { "null" }, { "null" }, { "1" }, { "2" }, { "3" }, { "4" } };
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class LimitAggregationFunctionTest method testAggregateFunctionLimitWithPredicate.
@Issue("3600")
@Test(dataProvider = "aggregationFunctionProvider")
public void testAggregateFunctionLimitWithPredicate(String function) {
String sqlQuery = String.format("SELECT %s(value) " + "FROM \"%s\" " + "WHERE datetime > '2016-06-03T09:23:00.000Z' AND datetime < '2016-06-03T09:23:10.000Z' ", function, testMetric);
StringTable tableWithoutLimit = queryTable(sqlQuery);
String limitSqlQuery = sqlQuery.concat("LIMIT 1");
assertSqlQueryRows(tableWithoutLimit.getRows().subList(0, 1), limitSqlQuery);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlSelectAllWithJoinTest method testSelectAllColumnsWithoutAlias.
@Issue("3033")
@Test
public void testSelectAllColumnsWithoutAlias() {
String sqlQuery = "SELECT * FROM \"sql-select-all-join-metric-1\" " + "JOIN \"sql-select-all-join-metric-2\"";
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<String> expectedColumnNames = Arrays.asList(TEST_METRIC1_NAME + ".time", TEST_METRIC1_NAME + ".datetime", TEST_METRIC1_NAME + ".value", TEST_METRIC1_NAME + ".text", TEST_METRIC1_NAME + ".metric", TEST_METRIC1_NAME + ".entity", TEST_METRIC1_NAME + ".tags", TEST_METRIC2_NAME + ".time", TEST_METRIC2_NAME + ".datetime", TEST_METRIC2_NAME + ".value", TEST_METRIC2_NAME + ".text", TEST_METRIC2_NAME + ".metric", TEST_METRIC2_NAME + ".entity", TEST_METRIC2_NAME + ".tags");
assertTableColumnsNames(expectedColumnNames, resultTable, true);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlSelectEntityTagsTest method testSelectTagsWithGroupByEntityTags.
@Issue("3062")
@Test
public void testSelectTagsWithGroupByEntityTags() {
String sqlQuery = String.format("SELECT entity, COUNT(value), entity.tags FROM \"%s\" %n" + "WHERE datetime >= '2016-06-03T09:27:00.000Z' AND datetime < '2016-06-03T09:27:02.001Z' %n" + "AND entity = '%s' %nGROUP BY entity, value", TEST_METRIC_NAME, TEST_ENTITY3_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<String> expectedColumn = Collections.singletonList("null");
assertTableContainsColumnValues(expectedColumn, resultTable, "entity.tags");
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlSelectEntityTagsTest method testSelectEntityTags.
@Issue("3062")
@Test
public void testSelectEntityTags() {
String sqlQuery = String.format("SELECT entity, value, entity.tags FROM \"%s\" %n" + "WHERE datetime >= '2016-06-03T09:27:00.000Z' AND datetime < '2016-06-03T09:27:02.001Z' %n" + "AND entity = '%s' %nORDER BY datetime", TEST_METRIC_NAME, TEST_ENTITY1_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<String> expectedColumn = Collections.singletonList("a=b;b=c");
assertTableContainsColumnValues(expectedColumn, resultTable, "entity.tags");
}
Aggregations