0

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

2 Answers 2

1

The flink run way is used to submit jobs to run on the cluster. And the way of python xxx.py is to run the job directly in the local memory

Sign up to request clarification or add additional context in comments.

Comments

0

with flink run there is some configuration to set in .sh, you could consider the flink run is some bash scripts plus to the python xx itself.

for more information you could go to $FLINK_HOME/bin/flink or flink-dist/src/flink-bin/flink

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.