Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-11965

Provide a REST API for flink to submit plain SQL flink jobs.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Table SQL / Client

    Description

      SQL Client has been able to use Flink with SQL without the need to write Java or Scala programs, avoiding tedious compilation and packaging work.However, SQL Client is used in Command-Line Interface (CLI), which is not convenient for remote application access. In addition, SQL Client must define sourceTable and sinkTable in yaml file and submit a job to flink cluster for each SQL statement processed.For a slightly more complex stream program is not easy to achieve through SQL Client.Therefore, it is necessary to provide a REST API for flink to submit plain SQL flink jobs.

      The SQL jobs REST API include:/job/submit、/job/list、/job/stop、/job/restart。Where "/job/submit" is used to submit the SQL job, and its parameters are passed through the JSON request.The JSON request looks like this: {"name":"myJob", "statements":"CREATE TABLE userTable (user BIGINT, message VARCHAR) WITH(type source, update-mode append, connector.type kafka, connector.version 0.10, connector.topic test-user, connector.startup-mode earliest-offset, connector.properties.0.key zookeeper.connect, connector.properties.0.value zkHost:2181/kafka_2_1_0, connector.properties.1.key bootstrap.servers, connector.properties.1.value kafkaHost:9099, format.type json, format.fail-on-missing-field true, format.derive-schema true); CREATE TABLE targetUserTable (user BIGINT, message VARCHAR) WITH(type sink, ……); CREATE APPEND VIEW appView SELECT user, message FROM userTable group by user, message; INSERT into targetUserTable SELECT user, message FROM appView;”}.name is the name of the job. statements  is the contents of a job, which contains multiple SQL statements(Support create table…., create view….., create append view….., insert into….. several types of SQL statements).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chenminghua chenminghua
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: