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 
{
        if (input_rows_count == 0)
            return result_type->createColumn();
        auto dictionary = helper.getDictionary(arguments[0].column);
        size_t level = 0;
        if (arguments.size() == 3)
        {
            if (!isColumnConst(*arguments[2].column))
                throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
                    "Illegal type of third argument of function {}. Expected const unsigned integer.",
                    getName());
            level = static_cast<size_t>(arguments[2].column->get64(0));
        }
        if (!dictionary->hasHierarchy())
            throw Exception(ErrorCodes::UNSUPPORTED_METHOD,
                "Dictionary {} does not support hierarchy",
                dictionary->getFullName());
        ColumnPtr res = dictionary->getDescendants(arguments[1].column, std::make_shared<DataTypeUInt64>(), level);
        return res;
    }
    mutable FunctionDictHelper helper;
};
}