On the access node, how to find the data node storing the key through the space partition key value?

Hi. In a TimescaleDB multi-node scenario, I want to directly use the existing information on AN and the spatial partition key value to be queried to find the data node name or host that stores the key.
Suppose I have a distribute hypertable like this:

CREATE TABLE sample
(
  smpl_time TIMESTAMPTZ NOT NULL,
  channel_id BIGINT NOT NULL,
  float_val DOUBLE PRECISION NULL,
);

SELECT create_distributed_hypertable('sample', 'smpl_time', 'channel_id',
    data_nodes => '{ "dn1", "dn2", "dn3"}');

It can be seen that the spatial dimension is channel_id.Now suppose I want to know which data node the data with channel_id = 23 will be stored or has been stored on. The SQL statement I might use looks like this:

SELECT myfunc(<channel_id>);

Expected to return information about the data node storing the channel_id.

What follows are some of my attempts or explorations.
I found that there is such a table _timescaledb_catalog.dimension_partition, which internally saves the range on the hash ring covered by each data node.Then there is such a function _timescaledb_internal.get_partition_hash(), which can calculate the hash value corresponding to channel_id, and then use this value to compare with the previous coverage to determine which data node it is.

I don’t know if my guess is correct. And if nodes are added or deleted, will this idea still remain correct? Is there a more concise and elegant way to achieve what I want.

It seems your guess is correct and the hashing function is exactly what you need.
I don’t think we have any elegant way to find the data node.