Closed LPauzies closed 3 months ago
chDB will load config.xml in cwd(current working dir). As chDB is a single node version of ClickHouse engine. Create on cluster is not supported in chDB.
So with config.xml
in current dir like:
<clickhouse>
<macros>
<shard>01</shard>
<replica>01</replica>
<cluster>cluster_1S_2R</cluster>
</macros>
</clickhouse>
and run chDB like:
from chdb import session as chs
sess = chs.Session('dir_you_want_to_keep_your_data')
sess.sql("CREATE DATABASE test ON CLUSTER '{cluster}'")
will got:
ChdbError: Code: 701. DB::Exception: Requested cluster 'cluster_1S_2R' not found. (CLUSTER_DOESNT_EXIST)
Hope this could help you.
I would want to use in memory clickhouse using chdb to gain performance and easy of use in our CI builds. However I will need to execute a "precomputed" dump of my Clickhouse node that contains some elements from the configuration, for example macros.
I would want to execute at least this kind of query :
Do you know a way to add these "macros" to chdb ? I dont find any documentation on this topic.
Many thanks !