You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by XU Qinghui <qi...@gmail.com> on 2021/03/02 10:55:32 UTC

How to get operator uid from a sql

Hello folks

I'm trying to use the flink state processor api to read the state of
operators from a checkpoint. But currently the operator look up in the API
relies on the operator `uid` (e.g. ExistingSavepoint.readKeyedState(uid,
readerFunction)).
But when it comes to a sql job, where should I look up for the operator
uid? I tried both the hexstring of the hash and the operator name, but
neither works.

Could you point me in the right direction?

BR,

Re: How to get operator uid from a sql

Posted by Matthias Pohl <ma...@ververica.com>.
Hi XU Qinghui,
sorry for the late reply. Unfortunately, the operator ID does not mean to
be accessible for Flink SQL through the API. You might have a chance to
extract the Operator ID through the debug
logs. StreamGraphHasherV2.generateDeterministicHash logs out the operator
ID [1]:
"[main] DEBUG org.apache.flink.streaming.api.graph.StreamGraphHasherV2 [] -
Generated hash 'cbc357ccb763df2852fee8c4fc7d55f2' for node [...]"
The hash refers to the operator ID.

Best,
Matthias

[1]
https://github.com/apache/flink/blob/c6997c97c575d334679915c328792b8a3067cfb5/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphHasherV2.java#L269

On Tue, Mar 2, 2021 at 11:56 AM XU Qinghui <qi...@gmail.com> wrote:

> Hello folks
>
> I'm trying to use the flink state processor api to read the state of
> operators from a checkpoint. But currently the operator look up in the API
> relies on the operator `uid` (e.g. ExistingSavepoint.readKeyedState(uid,
> readerFunction)).
> But when it comes to a sql job, where should I look up for the operator
> uid? I tried both the hexstring of the hash and the operator name, but
> neither works.
>
> Could you point me in the right direction?
>
> BR,
>