diff --git a/src/resources/proto/query.proto b/src/resources/proto/query.proto index 913a930b..d4d7e188 100644 --- a/src/resources/proto/query.proto +++ b/src/resources/proto/query.proto @@ -1,20 +1,24 @@ +/********************************************************************************************************************** + * REMOTE QUERY RELATED PROTOBUF DEFINITIONS * + * * + * Allocated TypeId range is: [4400 .. 4599] (see org.infinispan.commons.marshall.ProtoStreamTypeIds) * + * Actually used range is: [4400 .. 4403] * + *********************************************************************************************************************/ syntax = "proto3"; import "message-wrapping.proto"; package org.infinispan.query.remote.client; /** - * @TypeId(1000101) + * @TypeId(4400) */ message QueryRequest { /** - * The query string, expressed in Infinispan's query language (a JPA subset with full-text enhancements). - * NOTE: currently only a limited subset of the JPA query language is supported. + * The query string, in Infinispan's query language aka Ickle (a JP-QL micro-subset with full-text enhancements). */ string queryString = 1; - // NOTE: id 2 was used for sort criteria, which is now into the ORDER BY clause inside the query string /** * The number of matching results to skip before the first returned result. @@ -27,14 +31,18 @@ message QueryRequest { int32 maxResults = 4; /** - * Multiple, named parameters. Each name must occur only once. + * Multiple, optional, named parameters. Each name must occur only once. */ repeated NamedParameter namedParameters = 5; + /** + * Whether the query is limited to the data from node that receives the request + */ + bool local = 6; message NamedParameter { /** - * Parameter name. + * Parameter unique name. */ string name = 1; @@ -46,7 +54,7 @@ message QueryRequest { } /** - * @TypeId(1000102) + * @TypeId(4401) */ message QueryResponse { @@ -67,15 +75,20 @@ message QueryResponse { /** * The list of matching results. The size should be either numResults, if no projections are used, or numResults * * projectionSize otherwise. If projections are used, then each group of projectionSize consecutive elements - * represent together a result. + * represent together a row from the result. We use this simple schema in order to avoid bi-dimensional arrays when + * projections are present. */ repeated org.infinispan.protostream.WrappedMessage results = 3; - int64 totalResults = 4; + /** + * Total number of results that match the query. This is usually larger than numResults due to + * QueryRequest.startOffset and QueryRequest.maxResults. + */ + int64 totalResults = 4; } /** - * @TypeId(1000103) + * @TypeId(4402) */ message FilterResult { @@ -87,11 +100,10 @@ message FilterResult { } /** - * @TypeId(1000104) + * @TypeId(4403) */ message ContinuousQueryResult { - /* @TypeId(1000105) */ enum ResultType { LEAVING = 0; JOINING = 1; @@ -102,9 +114,9 @@ message ContinuousQueryResult { bytes key = 2; - /* Only present if resultType is JOINING or UPDATED and projection is missing */ + /* Only present if resultType is JOINING or UPDATED and 'projection' field is missing */ bytes value = 3; - /* Only present if jresultType is JOINING or UPDATED and value is missing */ + /* Only present if resultType is JOINING or UPDATED and 'value' field is missing */ repeated org.infinispan.protostream.WrappedMessage projection = 4; } diff --git a/test/Infinispan.HotRod.Tests/RemoteFulltextQueryTest.cs b/test/Infinispan.HotRod.Tests/RemoteFulltextQueryTest.cs index 289ea53e..e8d9fb2d 100644 --- a/test/Infinispan.HotRod.Tests/RemoteFulltextQueryTest.cs +++ b/test/Infinispan.HotRod.Tests/RemoteFulltextQueryTest.cs @@ -139,7 +139,7 @@ public void TestFullTextWithAggregation() IRemoteCache transactionCache = remoteManager.GetCache(NAMED_CACHE); QueryRequest qr = new QueryRequest(); - qr.QueryString = "select t.accountId, max(t.amount), max(t.description) from sample_bank_account.Transaction t where t.longDescription : (+'beer' -'food') group by t.accountId"; + qr.QueryString = "select t.accountId, max(t.amount), max(t.description) from sample_bank_account.Transaction t where t.longDescription : (+'beer') and t.longDescription : (-'food') group by t.accountId"; QueryResponse result = transactionCache.Query(qr); diff --git a/test/resources/proto2/bank.proto b/test/resources/proto2/bank.proto index 3797e399..c149fbba 100644 --- a/test/resources/proto2/bank.proto +++ b/test/resources/proto2/bank.proto @@ -95,7 +95,7 @@ message Account { } /** - * @Field(store = Store.YES)f + * @Field(store = Store.YES) */ optional Limits limits = 4;