22.2.2

```sql
create table source (a UInt64, b UInt64, c String) Engine= Memory;

insert into source select number, number, 'attr-'||toString(number) from numbers(10);

CREATE DICTIONARY dict1
( a UInt64 , b UInt64  HIERARCHICAL, c String
) PRIMARY KEY a
SOURCE(clickhouse(DB 'default' TABLE 'source'))
LIFETIME(300) LAYOUT(flat());

SELECT dictGetDescendants('dict1', toUInt64(2), 0)
DB::Exception: Illegal type of third argument of function dictGetDescendants
Expected const unsigned integer.: While processing dictGetDescendants('dict1', toUInt64(2), 0). (ILLEGAL_TYPE_OF_ARGUMENT)

-- but !

SELECT dictGetDescendants('dict1', materialize(toUInt64(2)), 0)
┌─dictGetDescendants('dict1', materialize(toUInt64(2)), 0)─┐
│ [2]                                                      │
└──────────────────────────────────────────────────────────┘

SELECT dictGetDescendants('dict1', number, 0)
FROM numbers(3)
┌─dictGetDescendants('dict1', number, 0)─┐
│ [0]                                    │
│ [1]                                    │
│ [2]                                    │
└────────────────────────────────────────┘
```

> "DB::Exception: Illegal type of third argument of function dictGetDescendants"

Also the message is incorrect, the problem is in the second argument,  not the third argument 
#include <Interpreters/ExternalDictionariesLoader.h>
#include <Interpreters/castColumn.h>
#include <Functions/IFunction.h>
#include <Functions/FunctionHelpers.h>
#include <base/range.h>
#include <type_traits>
namespace DB
{
namespace ErrorCodes
{
    extern const int ILLEGAL_TYPE_OF_ARGUMENT;
    extern const int UNSUPPORTED_METHOD;
    extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
    extern const int ILLEGAL_COLUMN;
    extern const int TYPE_MISMATCH;
}
/** Functions that use plug-ins (external) dictionaries_loader.
  *
  * Get the value of the attribute of the specified type.
  *     dictGetType(dictionary, attribute, id),
  *         Type - placeholder for the type name, any numeric and string types are currently supported.
  *        The type must match the actual attribute type with which it was declared in the dictionary structure.
  *
  * Get an array of identifiers, consisting of the source and parents chain.
  *  dictGetHierarchy(dictionary, id).
  *
  * Is the first identifier the child of the second.
  *  dictIsIn(dictionary, child_id, parent_id).
  */
class FunctionDictHelper : WithContext