Python API not working

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Python API not working

Yassine MARZOUGUI
Hi All,

I'm trying to use Flink with the python API, and started with the wordcount exemple from the Documentation. I'm using Flink 1.4 and python 2.7.
When running env.execute(local=True), the command doesn't execute and keeps waiting for input. If I hit enter again I get the following error from Environment.py : ValueError("Invalid mode specified: " + mode)
Looking at the source code, it looks like there are a bunch of sys.stdin.readline().rstrip('\n') where an input is expected from the user. Any idea how to run the job? Thank you. 

Best,
Yassine

Reply | Threaded
Open this post in threaded view
|

Re: Python API not working

Ufuk Celebi
Hey Yassine,

let me include Chesnay (cc'd) who worked on the Python API.

I'm not familiar with the API and what it expects, but try entering
`streaming` or `batch` for the mode. Chesnay probably has the details.

– Ufuk


On Fri, Dec 15, 2017 at 11:05 AM, Yassine MARZOUGUI
<[hidden email]> wrote:

> Hi All,
>
> I'm trying to use Flink with the python API, and started with the wordcount
> exemple from the Documentation. I'm using Flink 1.4 and python 2.7.
> When running env.execute(local=True), the command doesn't execute and keeps
> waiting for input. If I hit enter again I get the following error from
> Environment.py : ValueError("Invalid mode specified: " + mode)
> Looking at the source code, it looks like there are a bunch of
> sys.stdin.readline().rstrip('\n') where an input is expected from the user.
> Any idea how to run the job? Thank you.
>
> Best,
> Yassine
>
Reply | Threaded
Open this post in threaded view
|

Re: Python API not working

Yassine MARZOUGUI
Hi Ufuk,

Thanks for your response. Unfortunately specifying 'streaming` or `batch` doesn't work, it looks like mode should be either "plan" or "operator" , and then the program expects other inputs from the stdin (id, port, etc.).

2017-12-15 14:23 GMT+01:00 Ufuk Celebi <[hidden email]>:
Hey Yassine,

let me include Chesnay (cc'd) who worked on the Python API.

I'm not familiar with the API and what it expects, but try entering
`streaming` or `batch` for the mode. Chesnay probably has the details.

– Ufuk


On Fri, Dec 15, 2017 at 11:05 AM, Yassine MARZOUGUI
<[hidden email]> wrote:
> Hi All,
>
> I'm trying to use Flink with the python API, and started with the wordcount
> exemple from the Documentation. I'm using Flink 1.4 and python 2.7.
> When running env.execute(local=True), the command doesn't execute and keeps
> waiting for input. If I hit enter again I get the following error from
> Environment.py : ValueError("Invalid mode specified: " + mode)
> Looking at the source code, it looks like there are a bunch of
> sys.stdin.readline().rstrip('\n') where an input is expected from the user.
> Any idea how to run the job? Thank you.
>
> Best,
> Yassine
>

Reply | Threaded
Open this post in threaded view
|

Re: Python API not working

Yassine MARZOUGUI
Hi all,

Any ideas on this?


2017-12-15 15:10 GMT+01:00 Yassine MARZOUGUI <[hidden email]>:
Hi Ufuk,

Thanks for your response. Unfortunately specifying 'streaming` or `batch` doesn't work, it looks like mode should be either "plan" or "operator" , and then the program expects other inputs from the stdin (id, port, etc.).

2017-12-15 14:23 GMT+01:00 Ufuk Celebi <[hidden email]>:
Hey Yassine,

let me include Chesnay (cc'd) who worked on the Python API.

I'm not familiar with the API and what it expects, but try entering
`streaming` or `batch` for the mode. Chesnay probably has the details.

– Ufuk


On Fri, Dec 15, 2017 at 11:05 AM, Yassine MARZOUGUI
<[hidden email]> wrote:
> Hi All,
>
> I'm trying to use Flink with the python API, and started with the wordcount
> exemple from the Documentation. I'm using Flink 1.4 and python 2.7.
> When running env.execute(local=True), the command doesn't execute and keeps
> waiting for input. If I hit enter again I get the following error from
> Environment.py : ValueError("Invalid mode specified: " + mode)
> Looking at the source code, it looks like there are a bunch of
> sys.stdin.readline().rstrip('\n') where an input is expected from the user.
> Any idea how to run the job? Thank you.
>
> Best,
> Yassine
>


Reply | Threaded
Open this post in threaded view
|

Re: Python API not working

Chesnay Schepler
You can't run the python script directly, instead it must be submitted to a flink cluster using the pyflink.sh script, as
described in the documentation, which will in turn call the script with the appropriate parameters.

On 04.01.2018 11:08, Yassine MARZOUGUI wrote:
Hi all,

Any ideas on this?


2017-12-15 15:10 GMT+01:00 Yassine MARZOUGUI <[hidden email]>:
Hi Ufuk,

Thanks for your response. Unfortunately specifying 'streaming` or `batch` doesn't work, it looks like mode should be either "plan" or "operator" , and then the program expects other inputs from the stdin (id, port, etc.).

2017-12-15 14:23 GMT+01:00 Ufuk Celebi <[hidden email]>:
Hey Yassine,

let me include Chesnay (cc'd) who worked on the Python API.

I'm not familiar with the API and what it expects, but try entering
`streaming` or `batch` for the mode. Chesnay probably has the details.

– Ufuk


On Fri, Dec 15, 2017 at 11:05 AM, Yassine MARZOUGUI
<[hidden email]> wrote:
> Hi All,
>
> I'm trying to use Flink with the python API, and started with the wordcount
> exemple from the Documentation. I'm using Flink 1.4 and python 2.7.
> When running env.execute(local=True), the command doesn't execute and keeps
> waiting for input. If I hit enter again I get the following error from
> Environment.py : ValueError("Invalid mode specified: " + mode)
> Looking at the source code, it looks like there are a bunch of
> sys.stdin.readline().rstrip('\n') where an input is expected from the user.
> Any idea how to run the job? Thank you.
>
> Best,
> Yassine
>