I recently working on learning pyflink, but I was a little bit confused. We know that pyflink table API convert stream/batch into table and do some work on it and finally sink to where u want. However, there are several ways to create table env:
For batch example:
t_config = TableConfig()
env = ExecutionEnvironment.get_execution_environment()
t_env = BatchTableEnvironment.create(env, t_config)
and
env_settings = EnvironmentSettings.new_instance().in_batch_mode().use_blink_planner().build()
t_env = BatchTableEnvironment.create(evnironment_settings = env_settings)
but I found one of them only work for flink run -py batch.py, some other styles can be run as python batch.py for local run.
My question is what the difference of executionEnvironment and BatchTableEnvironment/StreamTableEnvironment, and when can use flink run -py and when can run by python interpreter with pyflink installed?
Thx
with
flink runthere is some configuration to set in.sh, you could consider theflink runis some bash scripts plus to thepython xxitself.for more information you could go to
$FLINK_HOME/bin/flinkorflink-dist/src/flink-bin/flink