[FLINK] sql-client 에서 작업이름(job name)을 직접 지정하는 방법
flink 를 쿼리로 작성해서 insert select 형태로 로직이 실행되면 대시보드의 Running Job List 의 이름이 획일적이라 구분이 쉽지 않다. 특히 동일한 테이블에서 조건만 다르게 N개의 로직을 돌리면 작업이름으로는 구분이 안되는 문제가 존재한다.
이런 문제를 해결하기위해서 쿼리 실행전에 작업이름을 지정하여 해결하는것이 가능하다.
insert-into_카탈로그명.데이터베이스명.테이블명
해결방법
다음과 같이 insert select 쿼리를 실행하기전에 SET 'pipeline.name' 형태로 이름을 지정하면 된다.
그러면 insert-into-default_catalog.default_database... 같은 이름이 아니라 사용자가 지정한 작업이름으로 등록된다.
SET 'pipeline.name' = '작업이름';
INSERT INTO es_target_data
SELECT
...
FROM
kafka_source_data
;
flink-client 를 이용해서 로직을 관리한다면 작업시 꼭 등록하는게 관리상 좋을것이다.
이 내용은 아래와 같이 sqlclient 관련 내용에 언급되어있다.
SQL Client
SQL Client # Flink’s Table & SQL API makes it possible to work with queries written in the SQL language, but these queries need to be embedded within a table program that is written in either Java or Scala. Moreover, these programs need to be packaged wi
nightlies.apache.org