```
apt-get install clickhouse-server=21.8.10.19 clickhouse-client=21.8.10.19  clickhouse-common-static=21.8.10.19

cat /etc/clickhouse-server/config.d/defdb.xml
<?xml version="1.0"?>
<yandex>
   <default_database>test</default_database>
</yandex>

cat /etc/clickhouse-server/node_dictionary.xml
<dictionaries>
    <dictionary>
        <name>node</name>
        <source>
            <file>
                <path>/etc/clickhouse-server/node.csv</path>
                <format>CSV</format>
            </file>
        </source>
        <lifetime>0</lifetime>
        <layout><flat /></layout>
        <structure>
            <id><name>key</name></id>
            <attribute>
                <name>name</name>
                <type>String</type>
                <null_value></null_value>
            </attribute>
        </structure>
    </dictionary>
</dictionaries>


cat /etc/clickhouse-server/node.csv
1,test


SELECT dictGet('node', 'name', toUInt64(1))
┌─dictGet('node', 'name', toUInt64(1))─┐
│ test                                 │
└──────────────────────────────────────┘

create database if not exists test;
create table test.test_null(A Int64) Engine=Null;
create table test.test_mt(S String) Engine=MergeTree order by S;

create materialized view test.test_mv to test_mt as  select dictGet('node', 'name', toUInt64(A)) S
from test.test_null;

insert into test_null select 1;
select * from test.test_mt;
┌─S────┐
│ test │
└──────┘
```

```
apt-get install clickhouse-server=21.8.11.4 clickhouse-client=21.8.11.4  clickhouse-common-static=21.8.11.4

/etc/init.d/clickhouse-server restart

SELECT dictGet('node', 'name', toUInt64(1));
┌─dictGet('node', 'name', toUInt64(1))─┐
│ test                                 │
└──────────────────────────────────────┘

insert into test_null select 1;
DB::Exception: Dictionary (`test.node`) not found: While processing dictGet('test.node', 'name', toUInt64(A)) AS S.
```
{
    auto qualified_name = QualifiedTableName::tryParseFromString(dictionary_name);
    if (!qualified_name)
    {
        QualifiedTableName qualified_dictionary_name;
        qualified_dictionary_name.table = dictionary_name;
        return qualified_dictionary_name;
    }
    if (qualified_name->database.empty() && has(dictionary_name))
    {
        
        return *qualified_name;
    }
    if (qualified_name->database.empty())
        qualified_name->database = query_context->getCurrentDatabase();
    return *qualified_name;
}
std::string ExternalDictionariesLoader::resolveDictionaryName(const std::string & dictionary_name, const std::string & current_database_name) const