基于社区版分支修改的flink-sql-gateway,可适用于flink on yarn + hive metastore的环境运行Flink SQL.
##当前支持的版本
flink-1.17.1
- show create table [table_name]
- lineage [sql]
- validate [sql]
- 支持执行statement set
-
localhost:8083/v1/job/submit
{ "cmd": "run-application -t yarn-application -Dyarn.application.queue=queue -Dyarn.application.name=job_1 --class main.class.path --parallelism 1 -Djobmanager.memory.process.size=1G -Dtaskmanager.memory.process.size=1G -Dtaskmanager.numberOfTaskSlots=1 /jarPath ", "dml": "insert into a select col from b" }
{ "errMsg": "", "applicationId": "" }
-
curl -X GET localhost:8083/v1/job/info
{ "errMsg": "", "data": [ { "appId": "application_1691879773392_7492", "jobName": "job_1", "trackingUrl": "http://id-staging-hadoop02-10-162-34-125:8088/proxy/application_1691879773392_7492/", "flinkJob": { "jobs": [ { "jid": "c9fbc5e7d36d4ae799adc41724a52265", "name": "job_1", "state": "RUNNING", "starttime": 1692166584952, "endtime": -1, "duration": 1543563587, "lastmodification": 1692166598695, "tasks": { "total": 1, "created": 0, "scheduled": 0, "deploying": 0, "running": 1, "finished": 0, "canceling": 0, "canceled": 0, "failed": 0, "reconciling": 0, "initializing": 0 } } ] } } ] }
-
curl -X POST localhost:8083/v1/job/stop
{"job_name": "job_1"}
{ "errMsg": "", "data": [ { "appId": "application_1692908509691_0937", "jobName": "job_1", "jobId": "aba961751cd19d7bbf262cf76e3bb5ea", "savepointUrl": "hdfs:///checkpoint/job_1/savepoint-aba961-474dff935940" } ] }
-
curl -X POST localhost:8083/v1/job/session
{ "cmd": "-s 4 -jm 4096 -tm 4096 -nm flink-session-cluster -d -Dyarn.application.queue=queue", "dml":"" }
{ "errMsg": "", "applicationId": "" }
-
curl -X POST localhost:8083/v1/job/savepoint
{ "job_name": "job_1" }
{ "errMsg": "", "data": [ { "appId": "application_1693600076624_0949", "jobName": "job_1", "jobId": "aba961751cd19d7bbf262cf76e3bb5ea", "savepointUrl": "hdfs:///checkpoint/job_1/savepoint-cc157a-e2309081942a" } ] }
-
curl -X POST localhost:8083/v1/jars/upload
UPLOADED_FILES /jar_local_url request {"job_name": "job_1"}
{ "filename": "/tmp/job_1/jar_local_url.jar", "status": "success" }