use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlSelectMetricTagsTest method testSelectMetricSpecifiedTagCaseSensitivityFalse.
@Issue("3056")
@Test
public void testSelectMetricSpecifiedTagCaseSensitivityFalse() {
String sqlQuery = String.format("SELECT metric.tags.tag %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.tag"), resultTable);
List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("V"));
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlEntityGroupsWhereClauseTest method testEntityGroupsNotInCaseSensitivitySet.
@Issue("3020")
@Test
public void testEntityGroupsNotInCaseSensitivitySet() {
EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE entity.groups NOT IN ('%s') %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_NAME, TEST_CASE_SENSITIVITY_GROUP_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.singletonList(Arrays.asList("2016-07-14T15:00:07.000Z", TEST_ENTITY_NAME, "0", TEST_ENTITY_GROUP1_NAME));
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlEntityGroupsWhereClauseTest method testEntityGroupsNotInSet.
@Issue("3020")
@Test
public void testEntityGroupsNotInSet() {
EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE entity.groups IN ('%s', 'group', '%s') %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_NAME, TEST_ENTITY_GROUP1_NAME, TEST_ENTITY_GROUP2_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.singletonList(Arrays.asList("2016-07-14T15:00:07.000Z", TEST_ENTITY_NAME, "0", TEST_ENTITY_GROUP1_NAME));
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlEntityGroupsWhereClauseTest method testEntityGroupsNotInOneElementSet.
@Issue("3020")
@Test
public void testEntityGroupsNotInOneElementSet() {
EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE NOT entity.groups IN ('%s') %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_NAME, TEST_ENTITY_GROUP1_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.emptyList();
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlEntityGroupsWhereClauseTest method testEntityGroupsInCaseSensitivitySet.
@Issue("3020")
@Test
public void testEntityGroupsInCaseSensitivitySet() {
EntityGroupMethod.addEntities(TEST_ENTITY_GROUP1_NAME, Collections.singletonList(TEST_ENTITY_NAME));
String sqlQuery = String.format("SELECT datetime, entity, value, entity.groups FROM \"%s\" %n" + "WHERE entity.groups IN ('%s') %nAND datetime = '2016-07-14T15:00:07.000Z' %n", TEST_METRIC_NAME, TEST_CASE_SENSITIVITY_GROUP_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.emptyList();
assertTableRowsExist(expectedRows, resultTable);
}
Aggregations