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 
{
public:
    explicit FunctionDictHelper(ContextPtr context_) : WithContext(context_) {}
    std::shared_ptr<const IDictionary> getDictionary(const String & dictionary_name)
    {
        auto current_context = getContext();
        auto dict = current_context->getExternalDictionariesLoader().getDictionary(dictionary_name, current_context);
        if (!access_checked)
        {
            current_context->checkAccess(AccessType::dictGet, dict->getDatabaseOrNoDatabaseTag(), dict->getDictionaryID().getTableName());
            access_checked = true;
        }
        return dict;
    }
    std::shared_ptr<const IDictionary> getDictionary(const ColumnPtr & column)
    {
        const auto * dict_name_col = checkAndGetColumnConst<ColumnString>(column.get());
        if (!dict_name_col)
            throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "Expected const String column");
        return getDictionary(dict_name_col->getValue<String>());
    }
    bool isDictGetFunctionInjective(const Block & sample_columns)