in src/Apache.IoTDB/SessionPool.cs [1691:1740]
public async Task<SessionDataSet> ExecuteQueryStatementAsync(string sql)
{
TSExecuteStatementResp resp;
TSStatus status;
var client = _clients.Take();
var req = new TSExecuteStatementReq(client.SessionId, sql, client.StatementId)
{
FetchSize = _fetchSize
};
try
{
resp = await client.ServiceClient.executeQueryStatementAsync(req);
status = resp.Status;
}
catch (TException e)
{
_clients.Add(client);
await Open(_enableRpcCompression);
client = _clients.Take();
req.SessionId = client.SessionId;
req.StatementId = client.StatementId;
try
{
resp = await client.ServiceClient.executeQueryStatementAsync(req);
status = resp.Status;
}
catch (TException ex)
{
_clients.Add(client);
throw new TException("Error occurs when executing query statement", ex);
}
}
if (_utilFunctions.VerifySuccess(status, SuccessCode, RedirectRecommendCode) == -1)
{
_clients.Add(client);
throw new TException("execute query failed", null);
}
_clients.Add(client);
var sessionDataset = new SessionDataSet(sql, resp, _clients, client.StatementId)
{
FetchSize = _fetchSize,
};
return sessionDataset;
}