[jira] [Created] (FLINK-18791) Simplify the logic of SqlCommandParser and CliClient

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-18791) Simplify the logic of SqlCommandParser and CliClient

Shang Yuanchun (Jira)
godfrey he created FLINK-18791:
----------------------------------

             Summary: Simplify the logic of SqlCommandParser and CliClient
                 Key: FLINK-18791
                 URL: https://issues.apache.org/jira/browse/FLINK-18791
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / Client
            Reporter: godfrey he
             Fix For: 1.12.0


Currently, {{SqlCommandParser}} parse a statement to a corresponding {{SqlCommandCall}}, and {{CliClient}} will do different action based on different {{SqlCommandCall}}. However, if a new kind of statement is supported (such as [SHOW CURRENT DDL|https://issues.apache.org/jira/browse/FLINK-18616], [SHOW CREATE TABLE|https://issues.apache.org/jira/browse/FLINK-16384]), we must implement them in planner and at the same time we need to add a new kind of {{SqlCommand}}, add new method in {{CliClient}} to execute the command  in sql client. Moreover the implementation may be forgotten in sql client (such as [FLINK-18059|https://issues.apache.org/jira/browse/FLINK-18059]).
To improve this, I propose {{SqlCommandParser}} returns {{Operation}}, and {{CliClient}} executes {{Operation}} directly. Meanwhile we can unify the print style of different kind of Operations. After this is finished, we need not to change the sql client if a new kind of statement is supported, only if customized print style is needed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)