use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlClauseWhereWithLimitDoubleTest method testMathematicalFunction.
@Issue("3282")
@Test
public void testMathematicalFunction() {
String sqlQuery = String.format("SELECT value FROM \"%s\"%nWHERE sqrt(1.01) > value LIMIT 1", TEST_METRIC_NAME);
Response response = queryResponse(sqlQuery);
StringTable resultTable = response.readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("0.89"));
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlClauseWhereWithLimitDoubleTest method testValueAsRightOperand.
@Issue("3282")
@Test
public void testValueAsRightOperand() {
String sqlQuery = String.format("SELECT value FROM \"%s\"%nWHERE 1.01 > value LIMIT 1", TEST_METRIC_NAME);
Response response = queryResponse(sqlQuery);
StringTable resultTable = response.readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("0.89"));
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlEntityTagsTest method testIsNullOperator.
@Issue("2926")
@Test
public void testIsNullOperator() {
String sqlQuery = String.format("SELECT entity.tags.tag4 FROM \"%s\"%nWHERE datetime='2016-06-19T11:00:00.000Z' " + "AND entity.tags.tag4 IS NULL AND entity = '%s'", TEST_METRIC_NAME, TEST_ENTITY_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("null"));
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlEntityTagsTest method testNotEqualsOperator.
@Issue("2926")
@Test
public void testNotEqualsOperator() {
String sqlQuery = String.format("SELECT entity.tags.tag1 FROM \"%s\" %n" + "WHERE datetime='2016-06-19T11:00:00.000Z' AND entity.tags.tag1 <> 'val2' %nAND entity = '%s'", TEST_METRIC_NAME, TEST_ENTITY_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.singletonList(Collections.singletonList("val1"));
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlEntityTagsTest method testIsNotNullOperator.
@Issue("2926")
@Test
public void testIsNotNullOperator() {
String sqlQuery = String.format("SELECT entity.tags.tag4 FROM \"%s\" %n" + "WHERE datetime='2016-06-19T11:00:00.000Z' AND entity.tags.tag4 IS NOT NULL %n" + "AND entity = '%s'", TEST_METRIC_NAME, TEST_ENTITY_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<List<String>> expectedRows = Collections.emptyList();
assertTableRowsExist(expectedRows, resultTable);
}
Aggregations