Skip to content

Latest commit

 

History

History
76 lines (51 loc) · 4.91 KB

NewSQLEngine.md

File metadata and controls

76 lines (51 loc) · 4.91 KB

SQL Engine V2 - Release Notes


1.Motivations

The current SQL query engine provides users the basic query capability for using familiar SQL rather than complex OpenSearch DSL. Based on NLPchina ES-SQL, many new features have been added additionally, such as semantic analyzer, semi-structured data query support, Hash Join etc. However, as we looked into more advanced SQL features, challenges started emerging especially in terms of correctness and extensibility (see Attributions). After thoughtful consideration, we decided to develop a new query engine to address all the problems met so far.


2.What's New

With the architecture and extensibility improved significantly, the following SQL features are able to be introduced in the new query engine:

As for correctness, besides full coverage of unit and integration test, we developed a new comparison test framework to ensure correctness by comparing with other databases. Please find more details in Testing.


3.What're Changed

3.1 Breaking Changes

Because of implementation changed internally, you can expect Explain output in a different format. For query protocol, there are slightly changes in the default response format:

  • Total: The total field represented how many documents matched in total no matter how many returned (indicated by size field). However, this field becomes meaningless because of post processing on DSL response in the new query engine. Thus, for now the total number is always same as size field.

3.2 Fallback Mechanism

For these unsupported features, the query will be forwarded to the old query engine by fallback mechanism. To avoid impact on your side, normally you won't see any difference in a query response. If you want to check if and why your query falls back to be handled by old SQL engine, please explain your query and check OpenSearch log for "Request is falling back to old SQL engine due to ...".

For the following features unsupported in the new engine, the query will be forwarded to the old query engine and thus you cannot use new features listed above:

  • Cursor: request with fetch_size parameter
  • JSON response format: was used to return OpenSearch DSL which is not accessible now. Replaced by default format in the new engine which is also in JSON.
  • Nested field query: including supports for nested field query
  • JOINs: including all types of JOIN queries
  • OpenSearch functions: fulltext search, metric and bucket functions

3.3 Limitations

You can find all the limitations in Limitations.


4.How it's Implemented

If you're interested in the new query engine, please find more details in Developer Guide, Architecture and other docs in the dev folder.


5.What's Next

As aforementioned, there are still popular SQL features unsupported in the new query engine yet. In particular, the following items are on our roadmap with high priority:

  1. Nested field queries
  2. JOIN support
  3. OpenSearch functions