ID | IEP-33 | |||||
Author | ||||||
Sponsor | ||||||
Created | 13 Mar 2018 | |||||
Status |
|
|
|
Table of Contents |
---|
...
// TODO: Define the problem to be solved.
Current SQL engine has a number of critical limitations:
This document is concerned only with engine's infrastructure. Query planning and statistics are non goals.
What to take in count:
"Source" - fundamental concept. Types:
Code Block | ||||
---|---|---|---|---|
| ||||
class QueryRequest {
QueryId queryId; // Global query ID
Collection<UUID> cacheDescriptorIds; // IDs of the caches being queried
Collection<UUID> nodeIds; // IDs of all nodes participating in the query
AffinityTopologyVersion topVer; // Topology version
SqlSchemaVersion schemaVer; // Expected schema version
MvccSnapshot mvccSnapshot; // MVCC snapshot
}
class QueryFragment {
QueryId queryId; // Global query ID
FragmentId fragmentId; // Unique fragment ID within a query
FragmentId sinkId; // Who will consume results of this fragment
String sql; // SQL to be executed
Map<UUID, QueryFragmentPartitions> part; // Involved partitions for every real cache participating in query
}
class QueryFragmentPartitions {
Map<UUID, Integer> partCnts; // Number of expected partitions to be reserved on nodes
Map<UUID, Collection<Integer>> parts; // Explicit partitions
}
class QueryBatch {
QueryId queryId; // Global query ID
FragmentId sourceId; // Source ID (producer)
FragmentId sinkId; // Sink ID (consumer)
UUID sourceNodeId; // Source node ID
int sourceParallelism; // Parallelism of a fragment on a given node
long batchId; // ID of the batch for the given source/sink pair (used for congestion control)
List<Row> rows; // Data rows
boolean last; // Whether this is the last batch
}
class QueryBatchAck {
QueryId queryId; // Global query ID
FragmentId sourceId // Source ID
int lastBatchId; // ID of the last acked batch
} |
...
// TODO: Describe project risks, such as API or binary compatibility issues, major protocol changes, etc.
// TODO: Links to discussions on the devlist, if applicable.
// TODO: Links to various reference documents, if applicable.
Tickets caused by H2 limitations:
Jira | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|