ClickHouse: XML dictionaries + MatView + 21.8.11 = DB::Exception: Dictionary not found

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.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

Ok, but ideally we should backport only security and stability issues. For minor issues like this, the user should apply a workaround or upgrade to newer release.