use of io.druid.sql.http.SqlQuery in project druid by druid-io.
the class SqlResourceTest method testResourceLimitExceeded.
@Test
public void testResourceLimitExceeded() throws Exception {
final QueryInterruptedException exception = doPost(new SqlQuery("SELECT DISTINCT dim1 FROM foo", ImmutableMap.<String, Object>of("maxMergingDictionarySize", 1))).lhs;
Assert.assertNotNull(exception);
Assert.assertEquals(exception.getErrorCode(), QueryInterruptedException.RESOURCE_LIMIT_EXCEEDED);
Assert.assertEquals(exception.getErrorClass(), ResourceLimitExceededException.class.getName());
}
use of io.druid.sql.http.SqlQuery in project druid by druid-io.
the class SqlResourceTest method testCannotConvert.
@Test
public void testCannotConvert() throws Exception {
// TRIM unsupported
final QueryInterruptedException exception = doPost(new SqlQuery("SELECT TRIM(dim1) FROM druid.foo", null)).lhs;
Assert.assertNotNull(exception);
Assert.assertEquals(QueryInterruptedException.UNKNOWN_EXCEPTION, exception.getErrorCode());
Assert.assertEquals(ISE.class.getName(), exception.getErrorClass());
Assert.assertTrue(exception.getMessage().contains("Cannot build plan for query: SELECT TRIM(dim1) FROM druid.foo"));
}
use of io.druid.sql.http.SqlQuery in project druid by druid-io.
the class SqlResourceTest method testCannotValidate.
@Test
public void testCannotValidate() throws Exception {
final QueryInterruptedException exception = doPost(new SqlQuery("SELECT dim3 FROM druid.foo", null)).lhs;
Assert.assertNotNull(exception);
Assert.assertEquals(QueryInterruptedException.UNKNOWN_EXCEPTION, exception.getErrorCode());
Assert.assertEquals(ValidationException.class.getName(), exception.getErrorClass());
Assert.assertTrue(exception.getMessage().contains("Column 'dim3' not found in any table"));
}
Aggregations