Flink SQL statement verification method and device, computer equipment and storage medium
Patent Information
- Application Number
- CA3180833
- Authority / Receiving Office
- CA · CA
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-11-02
- Filing Date
- 2022-11-02
- Publication Date
- 2026-08-11
- Estimated Expiration
- 2042-11-02
Abstract
Description
FLINK SQL STATEMENT VERIFICATION METHOD AND DEVICE, COMPUTER EQUIPMENT AND STORAGE MEDIUM Technical Field
[0001] The present disclosure relates to computer technical field, particularly to a Flink SQL statement verification method, apparatus, computer device and storage medium. Background
[0002] Along with rapid development of company service, producing data becomes explosive growth, the real-time platform department needs to provide easy-to-use, stable and efficient real-time data service for business department, more and more service operations based on big data real-time computing are used and play an important role in the internet field, such as real- time recommendation, real-time statistics on November 11st, real-time anti-fraud, etc. More and more service developers favor Flink SQL tasks. However, before the SQL task is submitted, some legality verification and metadata landing are required for subsequent development. How to quickly verify the Flink SQL task has become an urgent problem for application platform to think and solve.
[0003] At present, Flink SQL verification mainly runs on cluster server by submitting the Flink SQL statement information, watching error message in the running process, and the error message feeds back to the client from the cluster server takes a long time, thereby causing Flink SQL verification is less efficient. Invention Content
[0004] Based on this, it is necessary to provide a Flink SQL statement verification method, apparatus, computer device and storage medium.
[0005] A Flink SQL statement verification method comprises:
[0006] Receiving Flink SQL statement of verification request submitted by terminal;
[0007] Parsing to be verified Flink SQL statement in the verification request according to pre- configured verification information, obtaining metadata of the to be verified Flink SQL statement;
[0008] Verifying target number in metadata according to verification information to generate verification result;
[0009] Sending the verification result to terminal to display.
[0010] In an embodiment, the above-mentioned parsing to be verified Flink SQL statement in the verification request, obtaining metadata of the to be verified Flink SQL statement, comprising:
[0011] Generating syntax analyzer and lexical analyzer according to the verification information;
[0012] Parsing to be verified Flink SQL statement according to the syntax analyzer and the lexical analyzer to generate abstract syntax tree;
[0013] Generating the metadata according to the abstract syntax tree.
[0014] In an embodiment, the above-mentioned verification information includes service verification information, the verification result includes first result, verifying target number in meta data according to verification information to generate verification result, comprising:
[0015] Extracting metadata matching the service verification information from the metadata to obtain the target data;
[0016] Performing service verification on the target number in the metadata according to the service verification information to generate the first result.
[0017] In an embodiment, the above-mentioned verification information includes syntax verification information, the verification result includes second result, verifying target number in metadata according to verification information to generate verification result, comprising:
[0018] Performing syntax verification on target number in the metadata according to the syntax verification information to generate the second result.
[0019] In an embodiment, the above-mentioned target data includes data source ID referenced in the to be verified Flink SQL statement and system identifier of the system of data source belongs, performing service verification on the target number in the metadata according to the service verification information to generate the first result, comprising:
[0020] According to the system identifier of the system of the data source belongs, if the ID of the data source does not exist in the system of the data source belongs, and / or when the current account associated with the verification request does not have the reference authority of the data source, generating the verification result of failure target data verification.
[0021] In an embodiment, the above-mentioned target data includes queue identifier of message queue referenced in the to be verified Flink SQL statement and system identifier of message queue belongs, the method also comprises:
[0022] According to the system identifier of the system of the message queue belongs, if the queue identifier of the message queue does not exist in the system of the message queue belongs, and / or when the current account does not have the reference authority of the message queue, generating the verification result of failure service information verification.
[0023] In an embodiment, the above-mentioned verification result includes description information of failure verification, row and column information of the target data in to be verified Flink SQL statement, sending the verification result to terminal end for display, comprising:
[0024] Sending description information of failure verification, row and column information of the target data in to be verified Flink SQL statement to terminal end for display.
[0025] An Flink SQL statement verification apparatus, wherein, the apparatus comprises:
[0026] A receiving module configured to receive Flink SQL statement submitted by terminal;
[0027] A parsing module configured to parse to be verified Flink SQL statement in the verification request according to pre-configured verification information, obtaining metadata of the to be verified Flink SQL statement;
[0028] A verifying module configured to verify target number in metadata according to verification information to generate verification result;
[0029] A sending module configured to send the verification result to terminal to display.
[0030] A computer device, including a memory, a processor and a computer program stored in the memory and run on the processor configured to achieve following steps when the processor executes the computer program:
[0031] Receiving Flink SQL statement of verification request submitted by terminal;
[0032] Parsing to be verified Flink SQL statement in the verification request according to pre- configured verification information, obtaining metadata of the to be verified Flink SQL statement;
[0033] Verifying target number in metadata according to verification information to generate verification result;
[0034] Sending the verification result to terminal to display.
[0035] A computer readable storage medium stored with a computer program configured to achieve following steps when the processor executes the computer program:
[0036] Receiving Flink SQL statement of verification request submitted by terminal;
[0037] Parsing to be verified Flink SQL statement in the verification request, obtaining metadata of the to be verified Flink SQL statement;
[0038] Verifying target number in metadata according to verification information to generate verification result;
[0039] Sending the verification result to terminal to display.
[0040] The above-mentioned Flink SQL statement verification method, apparatus, computer device and storage medium, receiving Flink SQL statement of verification request submitted by terminal; parsing to be verified Flink SQL statement in the verification request according to pre-configured verification information, obtaining metadata of the to be verified Flink SQL statement; verifying target number in metadata according to verification information to generate verification result; sending the verification result to terminal to display. The present application can parse and verify Flink SQL statement in Flink SQL task before submitting the Flink SQL task for operation, specifically, according to pre-configured verification information, filtering out target data in Flink SQL statement, verifying target data and solving the current problem of directly submitting Flink SQL task to cluster server for operation to cause failure message and result in low operation efficiency due to the Flink SQL statement errors. Drawing Description
[0041] Figure 1 is an application environment diagram of a Flink SQL statement verification method in an embodiment;
[0042] Figure 2 is a process diagram of a Flink SQL statement verification method in an embodiment;
[0043] Figure 3 is a process diagram of steps of parsing to be verified Flink SQL statement in the verification request, obtaining metadata of the to be verified Flink SQL statement in an embodiment;
[0044] Figure 4 is an application environment diagram of a Flink SQL statement verification method in an embodiment;
[0045] Figure 5 is a structural diagram of a Flink SQL statement verification apparatus in an embodiment;
[0046] Figure 6 is an internal structural diagram of a computer device in an embodiment. Specific embodiment methods
[0047] In order to make clearer application purposes, technical solutions, and advantages, the present disclosure is further explained in detail with a particular embodiment thereof, and with reference to the drawings. It shall be appreciated that these descriptions are only intended to be illustrative, but not to limit the scope of the disclosure thereto.
[0048] The present application provides a Flink SQL statement verification method applied in the application environment from Figure 1. As shown in Figure 1, the application environment includes server 100 and terminal end 101, server 100 connects with terminal 101 through network 102 to achieve the Flink SQL statement verification method.
[0049] Server 100 is configured to receive the verification request of Flink SQL statement submitted by terminal end; parsing to be verified Flink SQL statement in the verification request according to pre-configured verification information, obtaining metadata of the to be verified Flink SQL statement; verifying target number in metadata according to verification information to generate verification result; sending the verification result to terminal 101 to display. Wherein, server 100 can be an independent server or a server cluster composed of a plurality of servers.
[0050] Terminal 101 is configured to send verification request of Flink SQL statement to server 100 and receive verification result fed back by server 100, and the verification result is displayed on terminal user interface. Terminal 101 can be but not limited to various personal computers, laptops, smart phones, tablets and portable wearable devices.
[0051] Network 102 is configured to achieve the network connection between terminal 101 and server 100, specifically, the network 102 can include many types of wired or wireless networks.
[0052] In an embodiment, as shown in Figure 2, a Flink SQL statement verification method is provided to apply to the server in Figure 1 as example, comprising following steps:
[0053] S11, receiving Flink SQL statement of verification request submitted by terminal.
[0054] Wherein, the above-mentioned Flink SQL statement is a set of standard SQL development language designed for Flink real-time computing to simplify the computing model and reduce the threshold for user to use real-time computing. The terminal receives the verification instruction of the Flink SQL statement and submits the verification request of Flink SQL statement to server. The verification request of the above-mentioned Flink SQL statement can include the to be verified Flink SQL statement.
[0055] S12, parsing to be verified Flink SQL statement in the verification request according to pre-configured verification information, obtaining metadata of the to be verified Flink SQL statement.
[0056] In the present application, the above-mentioned verification information can include syntax verification information and service verification information. The above syntax verification information can be a rule for verifying the syntax of Flink SQL statement. The above service verification information can be a service rule based on service requirements.
[0057] The above-mentioned to be verified Flink SQL statement is parsed according to the pre-configured verification information, obtaining metadata in the to be verified Flink SQL statement, specifically, the above-mentioned to be verified Flink SQL statement can be segmented according to the verification rule in the verification information, or can assemble a plurality of characters of a sentence into a plurality of words.
[0058] The above-mentioned metadata can include database name, data table name, field name, filed type and data source information referenced in the above-mentioned to be verified Flink SQL statement.
[0059] S13, verifying target number in metadata according to verification information to generate verification result.
[0060] In the present application, filtering out the target data in the metadata according to the verification information, and verifying the target data to generate verification result. Wherein, the metadata can be syntax verified according to the syntax verification information in the verification information and the metadata can be verified according to the service verification information in the verification information.
[0061] The above verification result can include the result of passing the verification or failing the verification. Further, the above-mentioned result can also include the row and column information of Flink SQL statement with failure verification and description information of failure verification. In addition, the description information of the failure verification can be specific reason for the failure verification, such as a service rule saying that a table without conforming to the JDBC type can not have account and password fields, then resulting in failure verification.
[0062] S14, sending the verification result to terminal to display.
[0063] In the present application, after server sends verification result to terminal, the terminal can mark Flink SQL statement of failure verification based on the row and column information in the verification result, such as highlighted displaying, displaying the description information of failure verification on interface.
[0064] In the present application, by setting the verification information to achieve Flink SQL statement verification before submitting for operation, so that the error reporting during operation process can be avoided to improve operation efficiency.
[0065] In one embodiment, as shown in Figure 3, the above-mentioned parsing to be verified Flink SQL statement in the verification request, obtaining metadata of the to be verified Flink SQL statement, comprising:
[0066] S131, generating syntax analyzer and lexical analyzer according to the verification information;
[0067] S132, parsing to be verified Flink SQL statement according to the syntax analyzer and the lexical analyzer to generate abstract syntax tree;
[0068] S133, generating the metadata according to the abstract syntax tree.
[0069] In the present application, the above-mentioned verification information is stored in the preset verification file, the verification file can be g4 file. The g4 file is the basis for antlr (Another Tool for Language Recognition) to generate a lexical analyzer and a syntax analyzer. This application pre-sets Flink SQL-related syntax rules and service rules in the verification file. The legal rules are agreed according to different SQL types. Then verifying the file and generating the syntax analyzer and the lexical analyzer. Wherein, the lexical analyzer includes lexical analysis rules, the rules are for assembling a plurality of characters in a sentence into a plurality of words. The syntax analyzer includes syntax analysis rules, the rules are for analyzing the entire sentence after word segmentation, and each word segmentation unit can be customized processing, so as to achieve own syntax analysis function.
[0070] In the present application, the above-mentioned parsing the Flink SQL statement according to the syntax analyzer and the lexical analyzer, generating abstract syntax tree, comprising:
[0071] The above-mentioned to be verified Flink SQL statement is segmented according to the lexical analyzer, this process breaks down a string of characters into meaningful code chunks, the code chunks are collectively called lexical unit. For example, let <semantics>a=1<annotation encoding="application / x-tex">a = 1< / annotation>< / semantics>, this program is usually decomposed into the following lexical unit: let, a, =, 1; whether a space is regarded as lexical unit depends on the meaning of the space in this language;
[0072] Parsing the lexical unit obtained from the above-mentioned lexical analyzer according to syntax analyzer, this process is to convert lexical unit stream into a tree composed of nested elements representing the program syntax structure, this tree is called "abstract syntax" tree" (abstract syntax code, AST)
[0073] The above-mentioned generating metadata according to abstract syntax tree, comprising:
[0074] Generating metadata according to each node in the abstract syntax tree.
[0075] In an embodiment, the above-mentioned verification information includes service verification information, the verification result includes first result, verifying target number in meta data according to verification information to generate verification result, comprising:
[0076] Extracting metadata matching the service verification information from the metadata to obtain the target data; |0077| Performing service verification on the target number in the metadata according to the service verification information to generate the first result.
[0078] Wherein, the above-mentioned service verification information can be such as if the data source ID exists, if Kafka consumption group exists and if current account has operation authority of corresponding data source or operation authority of consumption group etc. The above-mentioned service verification information can also be, for example, a JDBC-type data table cannot have an account field and a password field but must have a data source ID and a URL (Uniform Resource Locator). A Kafka-type data table must contain the consumer group ID and the consumer group ID must match the corresponding topic.
[0079] In a service scenario, if service verification information is set to the JBDC-type data table cannot have account number field and password field but must have data source ID and URL, the above-mentioned extracting the metadata that matches the service verification information and obtaining target data, can be:
[0080] From the above-mentioned metadata, extracting the JDBC-type data table, and the table correspondingly account number field, password field, data source ID and URL, obtaining target data.
[0081] The above-mentioned performing service verification on the target number in the metadata according to the service verification information to generate the first result, comprising:
[0082] Judging whether the JDBC-type data table has account number field, password field, data source ID and URL, if the JDBC-type data table does not exist account number field and password field but exists data source ID and URL, determining current verification passed.
[0083] In a service scenario, if service verification information is set to judge whether data source ID exists, the above-mentioned extracting the metadata that matches service verification information from metadata, obtaining target data, can be:
[0084] Extracting each data source ID and system identifier that each data source belongs from the above-mentioned metadata, each data source ID and the system identifier of each data source belongs are the above-mentioned target data.
[0085] The above-mentioned service verification of targe data in the metadata according to service verification information, generating first result, can be:
[0086] Querying whether there is a corresponding data source ID on each system according to system identifier of each data source belongs. If exists, the current service verification passes, otherwise, generating the first result that the current service verification fails. The present application provides service verification function of Flink SQL statement to achieve service verification other than syntax verification and make the verification of Flink SQL statement more flexible and scientific.
[0087] In an embodiment, the verification information includes syntax verification information, the verification result includes second result, verifying target number in metadata according to verification information to generate verification result, comprising:
[0088] Performing syntax verification on target number in the metadata according to the syntax verification information to generate the second result.
[0089] Wherein, the syntax verification information can be agreed according to different SQL types. For example, the syntax verification information of DDL (Data Definition Language) can be divided into create table / view / function. In another word, if the syntax is DDL type, the syntax format is Create Table, if the above-mentioned to be verified Flink SQL statement is not in the Create Table format, the current syntax verification fails, generating the second verification result that the current syntax verification fails. 100901 In the present application, a syntax verification scheme of Flink SQL statement is provided to achieve the general syntax verification function of Flink SQL statement.
[0091] In an embodiment, the target data includes data source ID referenced in the to be verified Flink SQL statement and system identifier of data source belongs, performing service verification on the target number in the metadata according to the service verification information to generate the first result, comprising:
[0092] According to the system identifier of the data source belongs, if the data source ID does not exist in the system of the data source belongs, and / or when the current account associated with the verification request does not have the reference authority of the data source, generating the verification result of failure target data verification.
[0093] In the present application, the above-mentioned service verification can be to verify whether data source ID referenced in the to be verified Flink SQL statement exists and whether current account has operation authority of the data source. Correspondingly, according to service verification information, the server extracts target data as the data source ID and the system identifier of the data source belongs. Furthermore, the server judges whether the data source ID exists on the system of the data source belongs according to the above-mentioned service verification information, and judges whether the current account has operation authority of data source in the system of the data source belongs. If the data source ID exists in the system of the data source belongs according to the system identifier of the data source belongs, the current account associated with the verification request has the reference authority of the data source, the verification passes; otherwise, the verification fails, generating failure verification result. 100941 The present application can achieve verification from the service aspect of the Flink SQL statement through service verification information and make Flink SQL statement more refined and scientific.
[0095] In an embodiment, the target data includes queue identifier of message queue referenced in the to be verified Flink SQL statement and system identifier of message queue belongs, the method also comprises:
[0096] According to the system identifier of the system of the message queue belongs, if the queue identifier of the message queue does not exist in the system of the message queue belonging to, and / or when the current account does not have the reference authority of the message queue, generating the verification result of failure service information verification.
[0097] In the present application, the above-mentioned service verification information can be to verify whether the message queue referenced in the to be verified Flink SQL statement exists and whether the current account has the reference authority of the message queue. Correspondingly, according to service verification information, the server extracts target data as queue identifier of the message queue and the system identifier of the message queue belongs. Furthermore, the server judges whether there is a queue identifier of the message queue on the system of the message queue belongs according to the above-mentioned business verification information and judges whether the current account has operation authority of the message queue in the system of the message queue belongs. If the queue ID of the message queue exists in the system of the message queue belongs according to the system ID of the message queue belongs, and the current account associated with the verification request has the reference authority of the message queue, the verification is passed, otherwise, the verification fails, and generating a failure verification result. Wherein, the above-mentioned queue identifier of the message queue can be a topic name of the message queue.
[0098] In an embodiment, the above-mentioned service verification information can also be verifying whether the consumption group ID of message queue referenced in the to be verified Flink SQL statement exists, and whether the current account has the reference authority of the consumption group of message queue. Correspondingly, the server extracts the consumption group ID of message queue referenced in the to be verified Flink SQL statement and the system identifier of the consumption group of message queue belongs. Furthermore, the server judges whether the consumption group ID of the message queue exists on the system of the consumption group of message queue belongs according to the above-mentioned service verification information and judges whether the current account has the operation authority of the consumption group of message queue in the system of the consumption group of message queue belongs. If the consumption group ID of message queue exists in the system of the consumption group of message queue belongs, and the current account has the reference authority of consumption group of message queue, the verification passes, otherwise the verification fails, and generating a failure verification. Wherein the above-mentioned message queue can be a Kafka message queue.
[0099] In the present application, by setting the service verification information related to the message queue, the verification of reference information of the message queue in the Flink SQL statement can be achieved, so that the verification information of Flink SQL statement is more flexible and has a winder use range.
[0100] In an embodiment, the verification result includes description information of failure verification, row and column information of the target data in to be verified Flink SQL statement, sending the verification result to terminal end for display, comprising:
[0101] Sending description information of failure verification, row and column information of the target data in to be verified Flink SQL statement to terminal end for display.
[0102] In the present application, after the server sends the verification result to the terminal, the terminal can mark the Flink SQL statement with failure verification based on the row and column information in the verification result, such as highlighted displaying and displaying description information of failure verification on interface. In the present application, marking the displaying verification result, so that the verification result can be more intuitively displayed on the terminal interface.
[0103] In an application scenario, the above-mentioned verification information can also be set as topic verification of Kafka message queue and verification of consumption group ID in hint mode, JDBC data source and table verification, Hbase cluster and table name verification, ElasticSearch (Based on Lucene Search Server), etc., and the verification result is fed back to the front-end display in form of interface, so as to prompt user the number of rows and columns of the Flink SQL statement with failure verification, and the detailed description of failure verification. These verification results largely avoid the impact of illegal SQL on the production environment.
[0104] In an embodiment, the above-mentioned method also comprises:
[0105] Receiving modification request of verification information;
[0106] Correspondingly modifying the above-mentioned verification information according to the modification request.
[0107] In the present application, considering service flexibility and syntax expansibility, any required verification files can be modified or added to meet the service requirements.
[0108] Please refer to Figure 4, Figure 4 is an application environment diagram of a Flink SQL statement verification method in an embodiment. As shown in Figure 4, this application environment includes a developer terminal 41, a server 42, a service interface 43, and an application 44. Wherein,
[0109] The developer terminal 41 submits the verification file written by the developer to the server, so that the server registers and runs the verification file. The server 42 provides a service interface 43 to receive the verification request of Flink SQL statement submitted by application 44; parsing to be verified Flink SQL statement in the verification request according to pre- configured verification information, obtaining metadata of the to be verified Flink SQL statement; verifying target number in metadata according to verification information to generate verification result; sending the verification result to application 44.
[0110] In an embodiment, as shown in Figure 5, an Flink SQL statement verification apparatus is provided, the apparatus comprises a receiving module 11, a parsing module 12, a verifying module 13 and a sending module 14, wherein:
[0111] A receiving module 11 configured to receive Flink SQL statement submitted by terminal;
[0112] A parsing module 12 configured to parse to be verified Flink SQL statement in the verification request according to pre-configured verification information, obtaining metadata of the to be verified Flink SQL statement;
[0113] A verifying module 13 configured to verify target number in metadata according to verification information to generate verification result;
[0114] A sending module 14 configured to send the verification result to terminal to display.
[0115] In an embodiment, the above-mentioned parsing module 12, generating syntax analyzer and lexical analyzer according to the verification information; parsing to be verified Flink SQL statement according to the syntax analyzer and the lexical analyzer to generate abstract syntax tree; generating the metadata according to the abstract syntax tree.
[0116] In an embodiment, the above-mentioned verification information includes service verification information, the verification result includes first result, the above-mentioned verifying module 13, extracting metadata matching the service verification information from the metadata to obtain the target data, performing service verification on the target number in the metadata according to the service verification information to generate the first result. |0117| In an embodiment, the above-mentioned verification information includes syntax verification information, the verification result includes second result, the above-mentioned verifying module 13, performing syntax verification on target number in the metadata according to the syntax verification information to generate the second result.
[0118] In an embodiment, the above-mentioned target data includes data source ID referenced in the to be verified Flink SQL statement and system identifier of data source belongs, the above-mentioned verifying module 13, according to the system identifier of the system of the data source belongs, if the data source ID does not exist in the system of the data source belongs, and / or if the current account associated with the verification request does not have the reference authority of the data source, generating the verification result of failure target data verification.
[0119] In an embodiment, the above-mentioned target data includes queue identifier of message queue referenced in the to be verified Flink SQL statement and system identifier of message queue belongs, the above-mentioned verifying module 13, according to the system identifier of the system of the message queue belongs, if the queue identifier of the message queue does not exist in the system of the message queue belongs, and / or if the current account does not have the reference authority of the message queue, generating the verification result of failure service information verification.
[0120] In an embodiment, the above-mentioned verification result includes description information of failure verification, row and column information of the target data in to be verified Flink SQL statement, the above-mentioned sending module 14 sends description information of failure verification, row and column information of the target data in to be verified Flink SQL statement to terminal end for display.
[0121] In an embodiment, a computer device is provided, the computer device can be a server whose internal structure diagram is shown in Figure 6. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. The processor of the computer device is configured to provide and control capabilities. The memory of the computer device includes non-volatile storage medium and internal memory. The memory of non-volatile storage medium has an operation system, computer programs and database. The internal memory provides an environment for the operation system and computer program running in a non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a resource allocation method for compiling a virtual machine.
[0122] In an embodiment, a computer device is provided, including a memory, a processor and a computer program stored in the memory and ran on the processor configured to achieve the following steps when the processor executes the computer program: receiving Flink SQL statement of verification request submitted by terminal; parsing to be verified Flink SQL statement in the verification request according to pre-configured verification information, obtaining metadata of the to be verified Flink SQL statement; verifying target number in metadata according to verification information to generate verification result; sending the verification result to terminal to display.
[0123] In an embodiment, the processor executes the computer program to achieve the above- mentioned parsing to be verified Flink SQL statement in the verification request, obtaining metadata of the to be verified Flink SQL statement, comprising:
[0124] Generating syntax analyzer and lexical analyzer according to the verification information;
[0125] Parsing to be verified Flink SQL statement according to the syntax analyzer and the lexical analyzer to generate abstract syntax tree;
[0126] Generating the metadata according to the abstract syntax tree.
[0127] In an embodiment, the above-mentioned verification information includes service verification information, the verification result includes first result, verifying target number in meta data according to verification information to generate verification result, comprising:
[0128] Extracting metadata matching the service verification information from the metadata to obtain the target data;
[0129] Performing service verification on the target number in the metadata according to the service verification information to generate the first result.
[0130] In an embodiment, the above-mentioned verification information includes syntax verification information, the verification result includes second result, verifying target number in metadata according to verification information to generate verification result, comprising:
[0131] Performing syntax verification on target number in the metadata according to the syntax verification information to generate the second result.
[0132] In an embodiment, the above-mentioned target data includes data source ID referenced in the to be verified Flink SQL statement and system identifier of the system of data source belongs, performing service verification on the target number in the metadata according to the service verification information to generate the first result, comprising:
[0133] According to the system identifier of the system of the data source belongs, if the ID of the data source does not exist in the system of the data source belongs, and / or when the current account associated with the verification request does not have the reference authority of the data source, generating the verification result of failure target data verification.
[0134] In an embodiment, the above-mentioned target data includes queue identifier of message queue referenced in the to be verified Flink SQL statement and system identifier of message queue belongs, the method also comprises:
[0135] According to the system identifier of the system of the message queue belongs, if the queue identifier of the message queue does not exist in the system of the message queue belongs, and / or when the current account does not have the reference authority of the message queue, generating the verification result of failure service information verification.
[0136] In an embodiment, the above-mentioned verification result includes description information of failure verification, row and column information of the target data in to be verified Flink SQL statement, sending the verification result to terminal end for display, comprising:
[0137] Sending description information of failure verification, row and column information of the target data in to be verified Flink SQL statement to terminal end for display.
[0138] In an embodiment, a computer readable storage medium is provided, the medium stored with computer program and the processor performs the following steps when executing the computer program: receiving Flink SQL statement of verification request submitted by terminal; parsing to be verified Flink SQL statement in the verification request according to pre-configured verification information, obtaining metadata of the to be verified Flink SQL statement; verifying target number in metadata according to verification information to generate verification result; sending the verification result to terminal to display.
[0139] In an embodiment, the processor executes the computer program to achieve the above- mentioned parsing to be verified Flink SQL statement in the verification request, obtaining metadata of the to be verified Flink SQL statement, comprising:
[0140] Generating syntax analyzer and lexical analyzer according to the verification information;
[0141] Parsing to be verified Flink SQL statement according to the syntax analyzer and the lexical analyzer to generate abstract syntax tree;
[0142] Generating the metadata according to the abstract syntax tree.
[0143] In an embodiment, the above-mentioned verification information includes service verification information, the verification result includes first result, verifying target number in meta data according to verification information to generate verification result, comprising:
[0144] Extracting metadata matching the service verification information from the metadata to obtain the target data;
[0145] Performing service verification on the target number in the metadata according to the service verification information to generate the first result.
[0146] In an embodiment, the above-mentioned verification information includes syntax verification information, the verification result includes second result, verifying target number in metadata according to verification information to generate verification result, comprising:
[0147] Performing syntax verification on target number in the metadata according to the syntax verification information to generate the second result.
[0148] In an embodiment, the above-mentioned target data includes data source ID referenced in the to be verified Flink SQL statement and system identifier of the system of data source belongs, performing service verification on the target number in the metadata according to the service verification information to generate the first result, comprising:
[0149] According to the system identifier of the system of the data source belongs, if the ID of the data source does not exist in the system of the data source belongs, and / or when the current account associated with the verification request does not have the reference authority of the data source, generating the verification result of failure target data verification. <semantics>⌈0150⌉<annotation encoding="application / x-tex">\lceil 0150 \rceil< / annotation>< / semantics> In an embodiment, the above-mentioned target data includes queue identifier of message queue referenced in the to be verified Flink SQL statement and system identifier of message queue belongs, the method also comprises:
[0151] According to the system identifier of the system of the message queue belongs, if the queue identifier of the message queue does not exist in the system of the message queue belongs, and / or when the current account does not have the reference authority of the message queue, generating the verification result of failure service information verification.
[0152] In an embodiment, the above-mentioned verification result includes description information of failure verification, row and column information of the target data in to be verified Flink SQL statement, sending the verification result to terminal end for display, comprising:
[0153] Sending description information of failure verification, row and column information of the target data in to be verified Flink SQL statement to terminal end for display.
[0154] The skilled in the art can understand that all or partial of procedures from the above- mentioned methods can be performed by computer program instructions through related hardware, the mentioned computer program can be stored in a non-volatile material computer readable storage medium, this computer can include various embodiment procedures from the abovementioned methods when execution. Any reference to the memory, the storage, the database, or the other media used in each embodiment provided in current application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programable ROM (PROM), electrically programmable ROM (EPRPMD), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an instruction but not limited to, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAMD), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SRAM (ESDRAM), synchronal link (Synchlink) DRAM (SLDRAM), memory bus (Rambus), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0155] The technical features of the above-mentioned embodiments can be randomly combined, for concisely statement, not all possible combinations of technical feature in the abovementioned embodiments are described. However, if there are no conflicts in the combinations of these technical features, it shall be within the scope of this description.
[0156] The above-mentioned embodiments are only several embodiments in this disclosure and the description is more specific and detailed but cannot be understood as the limitation of the scope of the invention patent. Evidently those ordinary skilled in the art can make various modifications and variations to the disclosure without departing from the spirit and scope of the disclosure. Therefore, the appended claims are intended to be construed as encompassing the described embodiment and all the modifications and variations coming into the scope of the disclosure.
Claims
<pat:ClaimStatement>Claims:< / pat:ClaimStatement> <pat:Claims com:id="claims"> <pat:Claim com:id="CLM-00001"> <pat:ClaimNumber>1< / pat:ClaimNumber> <pat:ClaimText>1. An apparatus for Flink structured query language (SQL) statement verifications, the apparatus comprising: a receiving module configured to receive a Flink SQL statement of a verification request submitted by a terminal; a parsing module configured to parse to be verified Flink SQL statement in the Flink SQL statement of the verification request according to pre-configured verification information, to obtain metadata of the to be verified Flink SQL statement, wherein the pre-configured verification information includes syntax verification information and service verification information, wherein the to be verified Flink SQL statement is segmented according to the pre-configured verification information; a verifying module configured to verify target data in the metadata according to the pre- configured verification information to generate verification result, wherein the verification results include a first result and a second result, wherein the first result is generated according to service verification information, and wherein the second result is generated according to syntax verification information; and a sending module configured to send the verification result to the terminal to display. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00002"> <pat:ClaimNumber>2< / pat:ClaimNumber> <pat:ClaimText>2. The apparatus of claim 1, wherein the parsing module is further configured to: generate syntax analyzer and lexical analyzer according to the pre-configured verification information; parse the to be verified Flink SQL statement according to the syntax analyzer and the lexical analyzer to generate abstract syntax tree; and generate the metadata according to the abstract syntax tree. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00003"> <pat:ClaimNumber>3< / pat:ClaimNumber> <pat:ClaimText>3. The apparatus of any one of claims 1 to 2, wherein the service verification information includes a service rule based on service requirements. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00004"> <pat:ClaimNumber>4< / pat:ClaimNumber> <pat:ClaimText>4. The apparatus of any one of claims 1 to 3, wherein the verifying module is further configured to: extract metadata matching service verification information from the metadata to obtain the target data; and perform service verification on the target data in the metadata according to the service verification information to generate the first result. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00005"> <pat:ClaimNumber>5< / pat:ClaimNumber> <pat:ClaimText>5. The apparatus of any one of claims 1 to 4, wherein, the syntax verification information includes a rule for verifying the syntax of the Flink SQL statement. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00006"> <pat:ClaimNumber>6< / pat:ClaimNumber> <pat:ClaimText>6. The apparatus of any one of claims 1 to 5, wherein the verifying module is further configured to perform syntax verification on the target data in the metadata according to syntax verification information to generate the second result. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00007"> <pat:ClaimNumber>7< / pat:ClaimNumber> <pat:ClaimText>7. The apparatus of any one of claims 4 to 6, wherein the target data includes a data source ID referenced in the to be verified Flink SQL statement and a system identifier of a system associated with a data source. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00008"> <pat:ClaimNumber>8< / pat:ClaimNumber> <pat:ClaimText>8. The apparatus of claim 7, wherein the verifying module is further configured to: according to the system identifier of the system associated with the data source, where if the data source ID does not exist in the system associated with the data source, generating the verification result of failure target data verification. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00009"> <pat:ClaimNumber>9< / pat:ClaimNumber> <pat:ClaimText>9. The apparatus of claim 7, wherein the verifying module is further configured to: according to the system identifier of the system associated with the data source, where if the data source ID does not exist in the system associated with the data source, where if a current account associated with the verification request does not have a reference authority of the data source, generating the verification result of failure target data verification. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00010"> <pat:ClaimNumber>10< / pat:ClaimNumber> <pat:ClaimText>10. The apparatus of any one of claims 5 to 6, wherein the target data includes a queue identifier of a message queue referenced in the to be verified Flink SQL statement and a system identifier of a system associated with the message queue. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00011"> <pat:ClaimNumber>11< / pat:ClaimNumber> <pat:ClaimText>11. The apparatus of claim 10, wherein the verifying module is further configured to: according to the system identifier of the system associated with the message queue, where if the queue identifier of the message queue does not exist in the system associated with the message queue, generating the verification result of failure service information verification. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00012"> <pat:ClaimNumber>12< / pat:ClaimNumber> <pat:ClaimText>12. The apparatus of claim 10, wherein the verifying module is further configured to: according to the system identifier of the system associated with the message queue, where if a current account does not have a reference authority of the message queue, generating the verification result of failure service information verification. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00013"> <pat:ClaimNumber>13< / pat:ClaimNumber> <pat:ClaimText>13. The apparatus of any one of claims 1 to 12, wherein the verification result includes description information of failure verification, row and column information of target data in to be verified Flink SQL statement. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00014"> <pat:ClaimNumber>14< / pat:ClaimNumber> <pat:ClaimText>14. The apparatus of any one of claims 1 to 13, wherein the sending module is further configured to send description information of failure verification, row and column information of target data in to be verified Flink SQL statement to a terminal end for display. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00015"> <pat:ClaimNumber>15< / pat:ClaimNumber> <pat:ClaimText>15. An electronic device for Flink SQL statement verifications, the electronic device includes: a memory storing data; and a processor configured to: receiving a Flink SQL statement of a verification request submitted by a terminal; parsing to be verified Flink SQL statement in the Flink SQL statement of the verification request according to pre-configured verification information, to obtain metadata of the to be verified Flink SQL statement, wherein the pre- configured verification information includes syntax verification information and service verification information, wherein the to be verified Flink SQL statement is segmented according to the pre-configured verification information; verifying target data in metadata according to the pre-configured verification information to generate verification result, wherein the verification results include a first result and a second result, wherein the first result is generated according to service verification information, and wherein the second result is generated according to syntax verification information; and sending the verification result to the terminal to display. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00016"> <pat:ClaimNumber>16< / pat:ClaimNumber> <pat:ClaimText>16. A computer-readable storage medium having recorded thereon instructions for execution by an apparatus for Flink SQL statement verifications, wherein the computer-readable storage medium includes the instructions for: receiving a Flink SQL statement of a verification request submitted by a terminal; parsing to be verified Flink SQL statement in the Flink SQL statement of the verification request according to pre-configured verification information, to obtain metadata of the to be verified Flink SQL statement, wherein the pre-configured verification information includes syntax verification information and service verification information, wherein the to be verified Flink SQL statement is segmented according to the pre-configured verification information; verifying target data in metadata according to the pre-configured verification information to generate verification result, wherein the verification results include a first result and a second result, wherein the first result is generated according to service verification information, and wherein the second result is generated according to syntax verification information; and sending the verification result to the terminal to display. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00017"> <pat:ClaimNumber>17< / pat:ClaimNumber> <pat:ClaimText>17. A statement verification method, wherein the method includes: receiving a Flink SQL statement of a verification request submitted by a terminal; parsing to be verified Flink SQL statement in the Flink SQL statement of the verification request according to pre-configured verification information, to obtain metadata of the to be verified Flink SQL statement, wherein the pre-configured verification information includes syntax verification information and service verification information, wherein the to be verified Flink SQL statement is segmented according to the pre-configured verification information; verifying target data in metadata according to the pre-configured verification information to generate verification result, wherein the verification results include a first result and a second result, wherein the first result is generated according to service verification information, and wherein the second result is generated according to syntax verification information; and sending the verification result to the terminal to display. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00018"> <pat:ClaimNumber>18< / pat:ClaimNumber> <pat:ClaimText>18. The method of claim 17, wherein the method further includes: generating syntax analyzer and lexical analyzer according to the pre-configured verification information; parsing the to be verified Flink SQL statement according to the syntax analyzer and the lexical analyzer to generate abstract syntax tree; and generating the metadata according to the abstract syntax tree. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00019"> <pat:ClaimNumber>19< / pat:ClaimNumber> <pat:ClaimText>19. The method of any one of claims 17 to 18, wherein the service verification information includes a service rule based on service requirements. < / pat:ClaimText> < / pat:Claim> <pat:Claim com:id="CLM-00020"> <pat:ClaimNumber>20< / pat:ClaimNumber> <pat:ClaimText>20. The method of any one of claims 17 to 19, wherein the syntax verification information includes a rule for verifying the syntax of the Flink SQL statement. < / pat:ClaimText> < / pat:Claim> < / pat:Claims>