In this video Maksim shows typical workflow with ClickHouse codebase
To give an overview of CH development he is implementing SHOW SETTING server feature.
https://github.com/ClickHouse/ClickHouse/pull/55979
Read more at Maksim’s blog https://maksimkita.com .
Useful commands
Install Prerequisites
sudo apt-get install git cmake ccache python3 ninja-build nasm yasm gawk lsb-release wget software-properties-common gnupg
Install and Use the Clang compiler
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo ./llvm.sh 17 all
Clone ClickHouse repository
git clone https://github.com/ClickHouse/ClickHouse.git
cd ClickHouse
git submodule update –init –recursive
Build ClickHouse
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/clang++-17 -DCMAKE_C_COMPILER=/usr/bin/clang-17
ninja -j64
Copy compiler_commands.json to ClickHouse folder
cd ..
cp build/compiler_commands.json .
Start ClickHouse server
cd build
cd programs
./clickhouse server
Start ClickHouse client
cd build
cd programs
./clickhouse client
Work with ClickHouse tables
CREATE TABLE test_table (id UInt64, value String) ENGINE=MergeTree ORDER BY id;
INSERT INTO test_table VALUES(0, ’Value’);
SELECT * FROM test_table;
SELECT id, value FROM test_table;
SHOW DATABASES;
SHOW TABLES;
USE system
SHOW TABLES;
USE default
SELECT * FROM system.settings FORMAT Vertical;
SELECT * FROM system.settings WHERE name = ‘max_threads‘ FORMAT Vertical;
Check style
sudo utils/check-style/check-style – n
Add git fork
git remote add clickhouse_fork your_fork_goes_here
Git push
git push –set-upstream clickhouse_fork your_branch_goes_here
Information referenced in this video:
https://github.com/ClickHouse/ClickHouse
https://clickhouse.com/docs/en/intro
https://clickhouse.com/docs/en/development/build
https://clickhouse.com/docs/en/development/developer-instruction
https://clickhouse.com/docs/en/development/architecture
https://clickhouse.com/docs/en/development/tests
Previous interview with Maksim
https://www.youtube.com/watch?v=9NPa_f_0YsQ