use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlIsNullOperatorTest method testNotIsNotNullMetricSpecifiedTag.
@Issue("2937")
@Test
public void testNotIsNotNullMetricSpecifiedTag() {
String sqlQuery = String.format("SELECT entity, datetime, value, tags.* %n" + "FROM \"%s\" %n" + "WHERE datetime >= '2016-06-19T11:00:00.000Z' and datetime < '2016-06-19T11:16:00.000Z' %n" + "AND NOT tags.tag4 IS NOT NULL %n", TEST_METRIC_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
List<List<String>> expectedRows = Arrays.asList(Arrays.asList(TEST_ENTITY1_NAME, "2016-06-19T11:00:00.000Z", "1", "val1", "null", "null"), Arrays.asList(TEST_ENTITY2_NAME, "2016-06-19T11:05:00.000Z", "2", "val2", "val2", "null"), Arrays.asList(TEST_ENTITY3_NAME, "2016-06-19T11:10:00.000Z", "3", "null", "val3", "null"));
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlModuloTest method testDividingPositiveByNegativeInteger.
@Issue("2922")
@Test
public void testDividingPositiveByNegativeInteger() {
String sqlQuery = String.format("SELECT m1.value AS \"num\", m2.value AS \"den\", m1.value %s m2.value AS \"modulo\" FROM \"%s\" m1 %n " + "OUTER JOIN \"%s\" m2 %nWHERE m1.datetime = '2016-06-03T09:25:00.000Z' AND m1.entity = '%s'", "%", TEST_METRIC1_NAME, TEST_METRIC2_NAME, TEST_ENTITY_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
String[][] expectedRows = { { "12.0", "-2.0", "0.0" } };
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlModuloTest method testDividingPositiveByPositiveInteger.
@Issue("2922")
@Test
public void testDividingPositiveByPositiveInteger() {
String sqlQuery = String.format("SELECT m1.value AS \"num\", m2.value AS \"den\", m1.value %s m2.value AS \"modulo\" FROM \"%s\" m1 %n " + "OUTER JOIN \"%s\" m2 %nWHERE m1.datetime = '2016-06-03T09:23:00.000Z' AND m1.entity = '%s'", "%", TEST_METRIC1_NAME, TEST_METRIC2_NAME, TEST_ENTITY_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
String[][] expectedRows = { { "7.0", "5.0", "2.0" } };
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlModuloTest method testDividingNullByNumber.
@Issue("2922")
@Test
public void testDividingNullByNumber() {
String sqlQuery = String.format("SELECT m1.value AS \"num\", m2.value AS \"den\", m1.value %s m2.value AS \"modulo\" FROM \"%s\" m1 %n " + "OUTER JOIN \"%s\" m2 %nWHERE m1.datetime = '2016-06-03T09:27:00.000Z' AND m1.entity = '%s'", "%", TEST_METRIC1_NAME, TEST_METRIC2_NAME, TEST_ENTITY_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
String[][] expectedRows = { { "10.0", "null", "null" } };
assertTableRowsExist(expectedRows, resultTable);
}
use of com.axibase.tsd.api.model.sql.StringTable in project atsd-api-test by axibase.
the class SqlModuloTest method testDividingNumberByNull.
@Issue("2922")
@Test
public void testDividingNumberByNull() {
String sqlQuery = String.format("SELECT m2.value AS \"num\", m1.value AS \"den\", m2.value %s m1.value AS \"modulo\" FROM \"%s\" m1 %n " + "OUTER JOIN \"%s\" m2 %nWHERE m1.datetime = '2016-06-03T09:27:00.000Z' AND m1.entity = '%s'", "%", TEST_METRIC1_NAME, TEST_METRIC2_NAME, TEST_ENTITY_NAME);
StringTable resultTable = queryResponse(sqlQuery).readEntity(StringTable.class);
String[][] expectedRows = { { "null", "10.0", "null" } };
assertTableRowsExist(expectedRows, resultTable);
}
Aggregations