Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we do multiprocessing or distributed computing through PyFlink? #21

Open
abhalawat opened this issue Feb 22, 2022 · 10 comments
Open

Comments

@abhalawat
Copy link

I am trying to get about 14million data and want this process to work faster.Is there any way PyFlink could help?

@dianfu
Copy link
Collaborator

dianfu commented Feb 22, 2022

@abhalawat It's processing the data in a distributed way. This is the ability of Flink runtime.

@abhalawat
Copy link
Author

abhalawat commented Feb 22, 2022

How will I achieve that?Will PyFlink help me do that?

@dianfu
Copy link
Collaborator

dianfu commented Feb 23, 2022

Yes, when you submit a PyFlink to a remote cluster, e.g. YARN, K8s, etc, it will execute it in a distributed manner (you need to set the parallelism to a value other than 1). See https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/deployment/cli/#submitting-pyflink-jobs for more details on how to submit PyFlink jobs to a remote cluster.

@abhalawat
Copy link
Author

I followed this doc and created task manager and job manager.But while running the first code i.e. 1_word_count.py.

I ma facing the error as:
flink

@dianfu
Copy link
Collaborator

dianfu commented Feb 24, 2022

Could you post the full exception stack?

@abhalawat
Copy link
Author

Sure here it is:
error1
error2
error3
error4

@dianfu
Copy link
Collaborator

dianfu commented Feb 24, 2022

@abhalawat From the exception stack, it failed to create the output directory. There should be some permission issues. You could change the sink connector to other connectors such as [print](https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/connectors/table/print/) to work around this problem.

@abhalawat
Copy link
Author

Should I change this command:

t_env.execute_sql("""
         CREATE TABLE mySink (
           word STRING,
           `count` BIGINT
         ) WITH (
           'connector' = 'filesystem',
           'format' = 'csv',
           'path' = '/opt/examples/table/output/word_count_output'
         )
     """)

@abhalawat
Copy link
Author

I created new folder for output named as result then too it was showing error:

output1
output2
output3
output4

@abhalawat
Copy link
Author

Also,In here connector has to be file system because I am attaching file in SQL query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants