Hello everyone, I am pretty new in flink and tryin...
# troubleshooting
m
Hello everyone, I am pretty new in flink and trying to use Python Table API, If i use stream api i am able to define “job_name” but i couldn’t do that with Table API. I saw something on stackoverflow but couldn’t be sure. Is it impossible to define job_name while using table api ?
d
Could you try if it works by setting configuration
pipeline.name
, see https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/deployment/config/#pipeline-name for more details
m
Hello @Dian Fu, Many thanks 🙂 let me try it
Copy code
apiVersion: <http://flink.apache.org/v1beta1|flink.apache.org/v1beta1>
kind: FlinkSessionJob
metadata:
  name: test1-raw
  namespace: flink
spec:
  deploymentName: test-deployment
  job:
    jarURI: <https://repo1.maven.org/maven2/org/apache/flink/flink-python_2.12/1.15.4/flink-python_2.12-1.15.4.jar> 
    entryClass: "org.apache.flink.client.python.PythonDriver"
    args: ["-py", "/opt/flink/usrlib/test1.py"]
    parallelism: 1
    upgradeMode: stateless
---
apiVersion: <http://flink.apache.org/v1beta1|flink.apache.org/v1beta1>
kind: FlinkSessionJob
metadata:
  name: test2-raw
  namespace: flink
spec:
  deploymentName: test-deployment
  flinkConfiguration:
    pipeline.name: test2-job
  job:
    jarURI:	<https://repo1.maven.org/maven2/org/apache/flink/flink-python_2.12/1.15.4/flink-python_2.12-1.15.4.jar>  
    entryClass: "org.apache.flink.client.python.PythonDriver"
    args: ["-py", "/opt/flink/usrlib/test2.py"]
    parallelism: 1
    upgradeMode: stateless
In my test1.py file i wrote;
Copy code
env.execute("test1_job")
Its creating jobs with name same name which is (“test1_job”) but the codes are working successfully. am i did wrong something ?
d
Are you testing the priority?
You original question is how to set job name for Table API.
m
test1-job is using DataStream API. test2-job is using Table API. They are different codes and i am trying to set name for test2-job. But test-2 job is using DataStream API job name. Thats why i asked how can i set job name for Table API
maybe i misunderstood the concepts
d
Oh, I have not noticed that you have submitted two jobs in the same spec.
I’m not sure what’s the behavior in this case. You could try submit the Table API job in a separate spec to see if
pipeline.name: test2-job
works.
m
You are right @Dian Fu I set;
Copy code
table_env.get_config().set("pipeline.name", 'kafka-to-s3')
and i gave the job name 🙂
🎉 1