Data query method and device
A data query and data source technology, applied in the direction of electrical digital data processing, special data processing applications, instruments, etc., can solve the problems of increased time cost, low efficiency, and complicated data query process, so as to reduce time cost and simplify user experience Operation and the effect of improving convenience
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0033] refer to figure 1 , shows a flow chart of the steps of Embodiment 1 of a data query method of the present invention, which specifically includes:
[0034] Step 101, analyzing the SQL query statement in the data query instruction to obtain the corresponding syntax elements;
[0035] The embodiment of the present invention can be applied to electronic devices, such as computers, servers, etc., to determine the corresponding data query operation according to the data source type carried in the SQL query statement in the received query command. In this way, the user can grasp the SQL The query method of the database is enough, without having to master the data query method of other types of data sources, which reduces the user's time cost, and when the queried data is switched between different types of data sources, the query method can be automatically converted to The query operation of the corresponding type of data source does not require the conversion of the query o...
Embodiment 2
[0044] refer to figure 2 , which shows a flow chart of steps in Embodiment 2 of a data query method according to an embodiment of the present invention, which may specifically include:
[0045] Step 201, analyzing the SQL query statement in the data query instruction to obtain the corresponding syntax elements;
[0046] Step 202, according to the grammatical element, determine each data source to be queried and the type of each data source; Wherein, the determined data source to be queried is only the Elasticsearch search engine data source;
[0047] Step 203, converting the SQL query statement into a query statement supported by the Elasticsearch search engine data source;
[0048] Step 204, use the query statement supported by the Elasticsearch search engine data source to query the Elasticsearch search engine data source.
[0049] With respect to the method embodiment one, the data source to be queried determined in the embodiment of the present invention is only the Ela...
example 1
[0054] The received SQL query statement is as follows:
[0055] select ip,logtimefrom indexName where ip='127.0.0.1';
[0056] The syntax elements obtained after parsing the above SQL query statement may specifically include: select field: ip, logtime; from field: indexName; where field: ip='127.0.0.1'.
[0057] Convert the above SQL query statement into a query statement supported by the Elasticsearch search engine data source:
[0058] 1. Process the select field: convert the select field into the acquisition field of the source object content of each document of the Elasticsearch search engine data source:
[0059]
[0060] 2. Process the from field: convert the from field into the index field corresponding to the Elasticsearch search engine data source:
[0061] indexName / _search
[0062] 3. Process the where field: convert the where field into the query filter field corresponding to the Elasticsearch search engine data source, and can correspond to the query compone...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


