How to get operator uid from a sql

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

How to get operator uid from a sql

XU Qinghui
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,
Reply | Threaded
Open this post in threaded view
|

Re: How to get operator uid from a sql

Matthias
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


On Tue, Mar 2, 2021 at 11:56 AM XU Qinghui <[hidden email]> 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,