Search in sources :

Example 1 with TestExecutionConfig

use of io.crate.testing.TestExecutionConfig in project crate by crate.

the class SQLIntegrationTestCase method execute.

/**
 * Execute an SQL Statement on a random node of the cluster
 *
 * @param stmt the SQL Statement
 * @param args the arguments to replace placeholders ("?") in the statement
 * @return the SQLResponse
 */
public SQLResponse execute(String stmt, Object[] args) {
    try {
        SQLResponse response = sqlExecutor.exec(new TestExecutionConfig(isJdbcEnabled(), isHashJoinEnabled()), stmt, args);
        this.response = response;
        return response;
    } catch (ElasticsearchTimeoutException e) {
        LOGGER.error("Timeout on SQL statement: {} {}", stmt, e);
        dumpActiveTasks();
        throw e;
    }
}
Also used : ElasticsearchTimeoutException(org.elasticsearch.ElasticsearchTimeoutException) TestExecutionConfig(io.crate.testing.TestExecutionConfig) SQLResponse(io.crate.testing.SQLResponse)

Aggregations

SQLResponse (io.crate.testing.SQLResponse)1 TestExecutionConfig (io.crate.testing.TestExecutionConfig)1 ElasticsearchTimeoutException (org.elasticsearch.ElasticsearchTimeoutException)1