forked from typedb/typedb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unification of Query Answers through common data structures - Part 2 (t…
…ypedb#2913) # Why is this PR needed? This PR is a continuation of typedb#2910 > It has been difficult to maintain and guarantee that various type of Graql Queries (e.g. get, insert, delete, aggregates min/max/sum/groups/etc, compute cluster/path/centrality/statistics and a few others) is always maintained through remote communication APIs (previously REST, now GRPC). Prior to this PR, `AggregateQuery` and `ComputeQuery` are error-prone and not always supported over GRPC. The main reason for this problem is because we have so many different return types for every query, that it becomes hard to guarantee that all queries are supported in a generic and reliable way. > In order to solve this problem, we need to consider how to unify all queries to return a common set of data structures. By guaranteeing that every query returns a common set of data structures, we can guarantee that every query is supported over the remote communication API (i.e. GRPC) because we have implemented the generic and common data structures. > Because of the nature of the problem, the solution will be a pretty big change in the code base. Thus, we will split it into multiple PRs and this is the second one. # What does the PR do? The next data structures we have identified is: - `AnswerGroup`: a list of `Answer`s as the members, and a `Concept` as the owner. The following changes were made in this PR: - implemented `AnswerGroup<T>` - unify all `AggregateQuery`s to return `List<Answer>` - made `ComputeQuery` and `AggregateQuery` implement streamable - implemented `AnswerGroup` to be sent over GRPC - removed NULL returns from `Transaction.Query.Iter` in GRPC - made all queries to have `.stream()` method and removed Streamble<T> interface - added downcasting methods for `Answer` classes - moved `ServerRPCIT` to `RemoteQueryIT`, from `engine` to `client` in `test-integration` - removed `.sub(..)` from `RemoteSchemaConcept` - made DeleteQuery returns ConceptSet - made UndefineQuery returns ConceptMap - made AggregateQuery returns a stream over GRPC - Cleaned up `QueryExecutor.run(..)` return types to always return `Stream<T extends Answer>` - CountQuery takes in variables and computes over distinct results - upgrade `client-nodejs` to support different types of `Answer`s that a Graql query can return - removed `dist` folder from `client-nodjs`. # Does it break backwards compatibility? Nope. # List of future improvements not on this PR Yes, plenty, such as (not limited to): - Make analytics return `Concept` rather than just `ConceptId` - Add more expressive test for evert Graql query executing over GRPC
- Loading branch information
1 parent
130de2b
commit 964206f
Showing
120 changed files
with
869 additions
and
879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
dist | ||
**/autogenerated/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.