[
https://issues.apache.org/jira/browse/FLINK-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15859496#comment-15859496
]
ASF GitHub Bot commented on FLINK-5183:
---------------------------------------
Github user GEOFBOT commented on the issue:
https://github.com/apache/flink/pull/3232
In the process of getting a more complex job to run, I've tested a basic
multi-job file (seen below) on an Amazon EMR YARN cluster and it works
successfully.
```
from flink.plan.Environment import get_environment
from flink.plan.Constants import INT, STRING, WriteMode
from flink.functions.GroupReduceFunction \
import GroupReduceFunction
from flink.functions.Aggregation import Sum
import sys
if __name__ == "__main__":
output_file = 'hdfs:/tmp/out.txt'
output_file2 = 'hdfs:/tmp/out2.txt'
env = get_environment()
data = env.from_elements((0,1),(1,2),(2,3),(2,10))
data \
.group_by(0) \
.aggregate(Sum, 1) \
.write_csv(output_file, write_mode=WriteMode.OVERWRITE)
env.execute()
env2 = get_environment()
data2 = env2.read_csv(output_file, (INT, INT))
data2 \
.first(2) \
.write_text(output_file2, write_mode=WriteMode.OVERWRITE)
env2.execute()
```
> [py] Support multiple jobs per Python plan file
> -----------------------------------------------
>
> Key: FLINK-5183
> URL: https://issues.apache.org/jira/browse/FLINK-5183
> Project: Flink
> Issue Type: Improvement
> Components: Python API
> Affects Versions: 1.1.3
> Reporter: Geoffrey Mon
> Priority: Minor
>
> Support running multiple jobs per Python plan file.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)