diff --git a/src/Nest/XPack/Sql/QuerySql/QuerySqlRequest.cs b/src/Nest/XPack/Sql/QuerySql/QuerySqlRequest.cs index 7219f42c6a7..d7331442705 100644 --- a/src/Nest/XPack/Sql/QuerySql/QuerySqlRequest.cs +++ b/src/Nest/XPack/Sql/QuerySql/QuerySqlRequest.cs @@ -15,8 +15,15 @@ public partial interface IQuerySqlRequest : ISqlRequest /// Unlike scroll, receiving the last page is enough to guarantee that the Elasticsearch state is cleared. /// /// - [DataMember(Name ="cursor")] + [DataMember(Name="cursor")] string Cursor { get; set; } + + /// + /// Return the results in a columnar fashion: one row represents all the values of a certain column from the current page of results. + /// The following formats can be returned in columnar orientation: json, yaml, cbor and smile. + /// + [DataMember(Name="columnar")] + bool? Columnar { get; set; } } public partial class QuerySqlRequest @@ -25,6 +32,10 @@ public partial class QuerySqlRequest /// > public string Cursor { get; set; } + /// + /// > + public bool? Columnar { get; set; } + /// /// > public int? FetchSize { get; set; } @@ -45,6 +56,7 @@ public partial class QuerySqlRequest public partial class QuerySqlDescriptor { string IQuerySqlRequest.Cursor { get; set; } + bool? IQuerySqlRequest.Columnar { get; set; } int? ISqlRequest.FetchSize { get; set; } QueryContainer ISqlRequest.Filter { get; set; } string ISqlRequest.Query { get; set; } @@ -70,5 +82,9 @@ public QuerySqlDescriptor Filter(Func, QueryConta /// /// > public QuerySqlDescriptor Cursor(string cursor) => Assign(cursor, (a, v) => a.Cursor = v); + + /// + /// > + public QuerySqlDescriptor Columnar(bool? columnar = true) => Assign(columnar, (a, v) => a.Columnar = v); } } diff --git a/src/Nest/XPack/Sql/QuerySql/QuerySqlResponse.cs b/src/Nest/XPack/Sql/QuerySql/QuerySqlResponse.cs index 62287f378bd..9199963078d 100644 --- a/src/Nest/XPack/Sql/QuerySql/QuerySqlResponse.cs +++ b/src/Nest/XPack/Sql/QuerySql/QuerySqlResponse.cs @@ -20,7 +20,16 @@ public class QuerySqlResponse : ResponseBase [DataMember(Name = "cursor")] public string Cursor { get; internal set; } + /// + /// If has been set to false, this property will contain the row values + /// [DataMember(Name = "rows")] public IReadOnlyCollection Rows { get; internal set; } = EmptyReadOnly.Collection; + + /// + /// If has been set to true, this property will contain the column values + /// + [DataMember(Name = "values")] + public IReadOnlyCollection Values { get; internal set; } = EmptyReadOnly.Collection; } }