Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update query #163

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions src/resources/proto/query.proto
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;

Expand All @@ -46,7 +54,7 @@ message QueryRequest {
}

/**
* @TypeId(1000102)
* @TypeId(4401)
*/
message QueryResponse {

Expand All @@ -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 {

Expand All @@ -87,11 +100,10 @@ message FilterResult {
}

/**
* @TypeId(1000104)
* @TypeId(4403)
*/
message ContinuousQueryResult {

/* @TypeId(1000105) */
enum ResultType {
LEAVING = 0;
JOINING = 1;
Expand All @@ -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;
}
2 changes: 1 addition & 1 deletion test/Infinispan.HotRod.Tests/RemoteFulltextQueryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void TestFullTextWithAggregation()
IRemoteCache<String, Transaction> transactionCache = remoteManager.GetCache<String, Transaction>(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);

Expand Down
2 changes: 1 addition & 1 deletion test/resources/proto2/bank.proto
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ message Account {
}

/**
* @Field(store = Store.YES)f
* @Field(store = Store.YES)
*/
optional Limits limits = 4;

Expand Down