# Response from SQL query does not contain "Rows" (Elastic.Clients.Elasticsearch 8.1.0 .NET)

**URL:** <https://discuss.elastic.co/t/response-from-sql-query-does-not-contain-rows-elastic-clients-elasticsearch-8-1-0-net/330791>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [April 26, 2023, 6:17am UTC](https://discuss.elastic.co/t/response-from-sql-query-does-not-contain-rows-elastic-clients-elasticsearch-8-1-0-net/330791 "2023-04-26T06:17:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![felix-stnr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix-stnr/32/120218_2.png) [@felix-stnr](https://discuss.elastic.co/u/felix-stnr)\
**Post date:** [April 26, 2023, 6:17am UTC](https://discuss.elastic.co/t/response-from-sql-query-does-not-contain-rows-elastic-clients-elasticsearch-8-1-0-net/330791/1 "2023-04-26T06:17:23Z")

</div>

I have an Elasticsearch cluster, which contains an index called `persons`. I want to query the documents of the index using the SQL API of Elasticsearch. When using the REST API of Elasticsearch via Kibana everything works fine:

```auto
POST /_sql?format=csv
{
  "query": "SELECT * FROM persons"
}

```

However, I want to execute this query within a .NET Web API project. Therefore, I am using the latest .NET client for Elasticsearch (Elastic.Clients.Elasticsearch 8.1.0). I have already set up and configured the client, which worked fine. Now I am trying to execute the same query as mentioned above using the Elasticsearch .NET client like this:

```auto
var response = await _elasticsearchClient.Sql
                     .QueryAsync(q => q.Query("SELECT * FROM persons"));

```

When executing this query, Elasticsearch returns a valid response. However, this response seems to contain no results (even though the index `persons` contains documents). To be more precise, the response does not contain a property called "Rows". I can e.g. only access the returned columns and the cursor but not the returned rows.

I took a look at the code on GitHub and saw that the `QueryResponse` class does not contain a "Rows" property (see [here](https://github.com/elastic/elasticsearch-net/blob/main/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs)). Am I missing something or does the Elastic.Clients.Elasticsearch 8.1.0 client not fully support the SQL API?

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [April 26, 2023, 7:07am UTC](https://discuss.elastic.co/t/response-from-sql-query-does-not-contain-rows-elastic-clients-elasticsearch-8-1-0-net/330791/2 "2023-04-26T07:07:21Z")

</div>

Hi, @felix-stnr.

You have found a bug in the client. We code generate many types in the new client, and due to a change in how the generated types are named, the partial class which adds the `Rows` property is no longer applying the property to the expected type.

To address this bug, I have raised [an issue](https://github.com/elastic/elasticsearch-net/issues/7663).

---

<div class="post-metadata">

**Author:** ![felix-stnr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix-stnr/32/120218_2.png) [@felix-stnr](https://discuss.elastic.co/u/felix-stnr)\
**Post date:** [April 26, 2023, 7:28am UTC](https://discuss.elastic.co/t/response-from-sql-query-does-not-contain-rows-elastic-clients-elasticsearch-8-1-0-net/330791/3 "2023-04-26T07:28:29Z")

</div>

Hi @stevejgordon,  
thanks for the fast response! Are there already any plans/estimations for the release date of the 8.1.1 version?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 24, 2023, 7:29am UTC](https://discuss.elastic.co/t/response-from-sql-query-does-not-contain-rows-elastic-clients-elasticsearch-8-1-0-net/330791/4 "2023-05-24T07:29:03Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
