ververica / flink-jdbc-driver

Apache License 2.0
128 stars 61 forks source link

support connection properties #6

Open zhuguangbin opened 4 years ago

zhuguangbin commented 4 years ago

Hi,

flink-jdbc-driver does not support connection properties currently. Thus, SessionClient connected to flink-sql-gateway cannot change Environment at session level.

For example, In my senario, I deployed a flink sql gateway , I use beeline to connect it and submit flink sql query. The query always submit to that one Flink Cluster based on flink-sql-gateway's configuration. The execution configuration like time-characteristic/max-parallelism cannot change as well. This is tremendous inconvenience.

I looked through flink-sql-gateway code. Actually it support overriding deployment/execution/tableconfig params at session level.

POST http://localhost:8083/v1/sessions

{ "planner":"blink", "properties": { "deployment.jobmanager":"helloflinkonk8s.test.rest.shbt2.k8s.flink.ads.qihoo.net:80", "execution.parallelism": 1000, "execution.max-parallelism": 1000 } }

Then, I looked through flink-jdbc-drive code. It just ignore connection properties. I improved it, and now it works. I'm using beeline :

!connect jdbc:flink://localhost:8083?planner=blink&deployment.jobmanager=helloflinkonk8s.ultron:8081&execution.max-parallelism=1000

zhuguangbin commented 4 years ago

I submitted a pull request , pls review