2020-04-03 13:23:32 +00:00
---
2022-08-28 14:53:34 +00:00
slug: /en/development/developer-instruction
2022-04-09 13:29:05 +00:00
sidebar_position: 61
sidebar_label: Getting Started
description: Prerequisites and an overview of how to build ClickHouse
2020-04-03 13:23:32 +00:00
---
2022-04-09 13:29:05 +00:00
# Getting Started Guide for Building ClickHouse
2019-11-21 15:03:19 +00:00
2022-12-22 09:33:11 +00:00
The building of ClickHouse is supported on Linux, FreeBSD and macOS.
2019-11-21 15:03:19 +00:00
2020-08-07 08:02:50 +00:00
If you use Windows, you need to create a virtual machine with Ubuntu. To start working with a virtual machine please install VirtualBox. You can download Ubuntu from the website: https://www.ubuntu.com/#download. Please create a virtual machine from the downloaded image (you should reserve at least 4GB of RAM for it). To run a command-line terminal in Ubuntu, please locate a program containing the word “terminal” in its name (gnome-terminal, konsole etc.) or just press Ctrl+Alt+T.
2019-11-21 15:03:19 +00:00
2020-03-18 14:55:01 +00:00
ClickHouse cannot work or build on a 32-bit system. You should acquire access to a 64-bit system and you can continue reading.
2020-01-18 15:44:08 +00:00
2020-05-25 07:03:12 +00:00
## Creating a Repository on GitHub {#creating-a-repository-on-github}
2019-11-21 15:03:19 +00:00
To start working with ClickHouse repository you will need a GitHub account.
2021-05-27 19:44:11 +00:00
You probably already have one, but if you do not, please register at https://github.com. In case you do not have SSH keys, you should generate them and then upload them on GitHub. It is required for sending over your patches. It is also possible to use the same SSH keys that you use with any other SSH servers - probably you already have those.
2019-11-21 15:03:19 +00:00
2020-03-20 10:10:48 +00:00
Create a fork of ClickHouse repository. To do that please click on the “fork” button in the upper right corner at https://github.com/ClickHouse/ClickHouse. It will fork your own copy of ClickHouse/ClickHouse to your account.
2019-11-21 15:03:19 +00:00
2020-03-20 10:10:48 +00:00
The development process consists of first committing the intended changes into your fork of ClickHouse and then creating a “pull request” for these changes to be accepted into the main repository (ClickHouse/ClickHouse).
2019-11-21 15:03:19 +00:00
To work with git repositories, please install `git` .
To do that in Ubuntu you would run in the command line terminal:
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
sudo apt update
sudo apt install git
2019-11-21 15:03:19 +00:00
2020-08-07 08:04:20 +00:00
A brief manual on using Git can be found here: https://education.github.com/git-cheat-sheet-education.pdf.
2020-03-22 13:53:46 +00:00
For a detailed manual on Git see https://git-scm.com/book/en/v2.
2019-11-21 15:03:19 +00:00
2020-05-25 07:03:12 +00:00
## Cloning a Repository to Your Development Machine {#cloning-a-repository-to-your-development-machine}
2019-11-21 15:03:19 +00:00
2020-03-20 10:10:48 +00:00
Next, you need to download the source files onto your working machine. This is called “to clone a repository” because it creates a local copy of the repository on your working machine.
2019-11-21 15:03:19 +00:00
In the command line terminal run:
2020-03-20 10:10:48 +00:00
2023-03-08 05:10:12 +00:00
git clone --recursive --shallow-submodules git@github.com:your_github_username/ClickHouse.git
2020-03-21 04:11:51 +00:00
cd ClickHouse
2020-03-20 10:10:48 +00:00
2023-03-29 16:33:15 +00:00
Or (if you'd like to use sparse checkout for submodules and avoid checking out unneeded files):
git clone git@github.com:your_github_username/ClickHouse.git
cd ClickHouse
./contrib/update-submodules.sh
2020-10-13 17:23:29 +00:00
Note: please, substitute *your_github_username* with what is appropriate!
2019-11-21 15:03:19 +00:00
This command will create a directory `ClickHouse` containing the working copy of the project.
It is important that the path to the working directory contains no whitespaces as it may lead to problems with running the build system.
2020-03-20 10:10:48 +00:00
Please note that ClickHouse repository uses `submodules` . That is what the references to additional repositories are called (i.e. external libraries on which the project depends). It means that when cloning the repository you need to specify the `--recursive` flag as in the example above. If the repository has been cloned without submodules, to download them you need to run the following:
2020-03-21 04:11:51 +00:00
git submodule init
git submodule update
2020-03-20 10:10:48 +00:00
2020-03-18 14:55:01 +00:00
You can check the status with the command: `git submodule status` .
2019-11-21 15:03:19 +00:00
If you get the following error message:
2020-03-21 04:11:51 +00:00
Permission denied (publickey).
fatal: Could not read from remote repository.
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
Please make sure you have the correct access rights
and the repository exists.
2020-03-20 10:10:48 +00:00
2019-11-21 15:03:19 +00:00
It generally means that the SSH keys for connecting to GitHub are missing. These keys are normally located in `~/.ssh` . For SSH keys to be accepted you need to upload them in the settings section of GitHub UI.
You can also clone the repository via https protocol:
2020-03-20 10:10:48 +00:00
2023-03-08 05:01:38 +00:00
git clone --recursive --shallow-submodules https://github.com/ClickHouse/ClickHouse.git
2020-03-20 10:10:48 +00:00
2020-03-18 14:55:01 +00:00
This, however, will not let you send your changes to the server. You can still use it temporarily and add the SSH keys later replacing the remote address of the repository with `git remote` command.
2019-11-21 15:03:19 +00:00
2022-06-02 13:01:59 +00:00
You can also add original ClickHouse repo address to your local repository to pull updates from there:
2019-11-21 15:03:19 +00:00
2020-03-21 04:11:51 +00:00
git remote add upstream git@github.com:ClickHouse/ClickHouse.git
2020-03-20 10:10:48 +00:00
After successfully running this command you will be able to pull updates from the main ClickHouse repo by running `git pull upstream master` .
2019-11-21 15:03:19 +00:00
2020-05-25 07:03:12 +00:00
### Working with Submodules {#working-with-submodules}
2020-02-26 15:46:47 +00:00
Working with submodules in git could be painful. Next commands will help to manage it:
2021-10-17 23:29:04 +00:00
# ! each command accepts
2020-03-21 04:11:51 +00:00
# Update remote URLs for submodules. Barely rare case
git submodule sync
# Add new submodules
git submodule init
# Update existing submodules to the current state
git submodule update
# Two last commands could be merged together
git submodule update --init
2020-02-26 15:46:47 +00:00
2020-03-18 14:55:01 +00:00
The next commands would help you to reset all submodules to the initial state (!WARNING! - any changes inside will be deleted):
2020-02-26 15:46:47 +00:00
2020-03-21 04:11:51 +00:00
# Synchronizes submodules' remote URL with .gitmodules
2021-10-17 23:29:04 +00:00
git submodule sync
2020-03-21 04:11:51 +00:00
# Update the registered submodules with initialize not yet initialized
2021-10-17 23:29:04 +00:00
git submodule update --init
2020-03-21 04:11:51 +00:00
# Reset all changes done after HEAD
git submodule foreach git reset --hard
# Clean files from .gitignore
git submodule foreach git clean -xfd
# Repeat last 4 commands for all submodule
2021-10-17 23:29:04 +00:00
git submodule foreach git submodule sync
git submodule foreach git submodule update --init
2020-03-21 04:11:51 +00:00
git submodule foreach git submodule foreach git reset --hard
git submodule foreach git submodule foreach git clean -xfd
2020-03-20 10:10:48 +00:00
2020-05-25 07:03:12 +00:00
## Build System {#build-system}
2019-11-21 15:03:19 +00:00
ClickHouse uses CMake and Ninja for building.
CMake - a meta-build system that can generate Ninja files (build tasks).
2020-03-18 14:55:01 +00:00
Ninja - a smaller build system with a focus on the speed used to execute those cmake generated tasks.
2019-11-21 15:03:19 +00:00
To install on Ubuntu, Debian or Mint run `sudo apt install cmake ninja-build` .
On CentOS, RedHat run `sudo yum install cmake ninja-build` .
If you use Arch or Gentoo, you probably know it yourself how to install CMake.
2020-05-25 07:03:12 +00:00
## C++ Compiler {#c-compiler}
2019-11-21 15:03:19 +00:00
2022-10-09 00:54:00 +00:00
Compilers Clang starting from version 15 is supported for building ClickHouse.
2019-11-21 15:03:19 +00:00
2021-04-22 01:20:03 +00:00
Clang should be used instead of gcc. Though, our continuous integration (CI) platform runs checks for about a dozen of build combinations.
2019-11-21 15:03:19 +00:00
2021-04-22 01:20:03 +00:00
On Ubuntu/Debian you can use the automatic installation script (check [official webpage ](https://apt.llvm.org/ ))
2019-11-21 15:03:19 +00:00
2021-04-22 01:20:03 +00:00
```bash
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
```
2019-11-21 15:03:19 +00:00
2020-05-25 07:03:12 +00:00
## The Building Process {#the-building-process}
2019-11-21 15:03:19 +00:00
Now that you are ready to build ClickHouse we recommend you to create a separate directory `build` inside `ClickHouse` that will contain all of the build artefacts:
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
mkdir build
cd build
2020-03-20 10:10:48 +00:00
2020-10-13 17:23:29 +00:00
You can have several different directories (build_release, build_debug, etc.) for different types of build.
2019-11-21 15:03:19 +00:00
2021-04-22 01:20:03 +00:00
While inside the `build` directory, configure your build by running CMake. Before the first run, you need to define environment variables that specify compiler.
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
export CC=clang CXX=clang++
cmake ..
2019-12-11 10:57:35 +00:00
2022-10-09 00:54:00 +00:00
If you installed clang using the automatic installation script above, also specify the version of clang installed in the first command, e.g. `export CC=clang-15 CXX=clang++-15` . The clang version will be in the script output.
2022-01-11 07:24:09 +00:00
2019-11-21 15:03:19 +00:00
The `CC` variable specifies the compiler for C (short for C Compiler), and `CXX` variable instructs which C++ compiler is to be used for building.
2020-03-18 14:55:01 +00:00
For a faster build, you can resort to the `debug` build type - a build with no optimizations. For that supply the following parameter `-D CMAKE_BUILD_TYPE=Debug` :
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
cmake -D CMAKE_BUILD_TYPE=Debug ..
2020-03-20 10:10:48 +00:00
2019-11-21 15:03:19 +00:00
You can change the type of build by running this command in the `build` directory.
Run ninja to build:
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
ninja clickhouse-server clickhouse-client
2020-03-20 10:10:48 +00:00
2019-11-21 15:03:19 +00:00
Only the required binaries are going to be built in this example.
If you require to build all the binaries (utilities and tests), you should run ninja with no parameters:
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
ninja
2019-11-21 15:03:19 +00:00
Full build requires about 30GB of free disk space or 15GB to build the main binaries.
2022-06-03 11:50:17 +00:00
When a large amount of RAM is available on build machine you should limit the number of build tasks run in parallel with `-j` parameter:
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
ninja -j 1 clickhouse-server clickhouse-client
2020-03-20 10:10:48 +00:00
2020-03-18 14:55:01 +00:00
On machines with 4GB of RAM, it is recommended to specify 1, for 8GB of RAM `-j 2` is recommended.
2019-11-21 15:03:19 +00:00
If you get the message: `ninja: error: loading 'build.ninja': No such file or directory` , it means that generating a build configuration has failed and you need to inspect the message above.
2020-03-20 10:10:48 +00:00
Upon the successful start of the building process, you’ ll see the build progress - the number of processed tasks and the total number of tasks.
2019-11-21 15:03:19 +00:00
2022-10-09 00:54:00 +00:00
While building messages about LLVM library may show up. They affect nothing and are safe to be ignored.
2019-11-21 15:03:19 +00:00
2020-04-01 23:51:21 +00:00
Upon successful build you get an executable file `ClickHouse/<build_dir>/programs/clickhouse` :
2019-11-21 15:03:19 +00:00
2020-04-01 23:51:21 +00:00
ls -l programs/clickhouse
2019-11-21 15:03:19 +00:00
2020-05-25 07:03:12 +00:00
## Running the Built Executable of ClickHouse {#running-the-built-executable-of-clickhouse}
2019-11-21 15:03:19 +00:00
2020-04-01 23:51:21 +00:00
To run the server under the current user you need to navigate to `ClickHouse/programs/server/` (located outside of `build` ) and run:
2019-11-21 15:03:19 +00:00
2020-05-03 17:14:29 +00:00
../../build/programs/clickhouse server
2019-11-21 15:03:19 +00:00
2020-03-18 14:55:01 +00:00
In this case, ClickHouse will use config files located in the current directory. You can run `clickhouse server` from any directory specifying the path to a config file as a command-line parameter `--config-file` .
2019-11-21 15:03:19 +00:00
2020-08-07 08:18:38 +00:00
To connect to ClickHouse with clickhouse-client in another terminal navigate to `ClickHouse/build/programs/` and run `./clickhouse client` .
2019-11-21 15:03:19 +00:00
2022-12-22 09:33:11 +00:00
If you get `Connection refused` message on macOS or FreeBSD, try specifying host address 127.0.0.1:
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
clickhouse client --host 127.0.0.1
2019-11-21 15:03:19 +00:00
2020-03-18 14:55:01 +00:00
You can replace the production version of ClickHouse binary installed in your system with your custom-built ClickHouse binary. To do that install ClickHouse on your machine following the instructions from the official website. Next, run the following:
2020-03-20 10:10:48 +00:00
2020-03-21 04:11:51 +00:00
sudo service clickhouse-server stop
2020-04-01 23:51:21 +00:00
sudo cp ClickHouse/build/programs/clickhouse /usr/bin/
2020-03-21 04:11:51 +00:00
sudo service clickhouse-server start
2019-11-21 15:03:19 +00:00
Note that `clickhouse-client` , `clickhouse-server` and others are symlinks to the commonly shared `clickhouse` binary.
2020-03-18 14:55:01 +00:00
You can also run your custom-built ClickHouse binary with the config file from the ClickHouse package installed on your system:
2019-11-21 15:03:19 +00:00
2020-03-21 04:11:51 +00:00
sudo service clickhouse-server stop
2020-04-01 23:51:21 +00:00
sudo -u clickhouse ClickHouse/build/programs/clickhouse server --config-file /etc/clickhouse-server/config.xml
2019-11-21 15:03:19 +00:00
2020-05-25 07:03:12 +00:00
## IDE (Integrated Development Environment) {#ide-integrated-development-environment}
2019-11-21 15:03:19 +00:00
2022-12-22 09:33:11 +00:00
If you do not know which IDE to use, we recommend that you use CLion. CLion is commercial software, but it offers 30 days free trial period. It is also free of charge for students. CLion can be used both on Linux and on macOS.
2019-11-21 15:03:19 +00:00
2020-03-20 10:10:48 +00:00
KDevelop and QTCreator are other great alternatives of an IDE for developing ClickHouse. KDevelop comes in as a very handy IDE although unstable. If KDevelop crashes after a while upon opening project, you should click “Stop All” button as soon as it has opened the list of project’ s files. After doing so KDevelop should be fine to work with.
2019-11-21 15:03:19 +00:00
2020-03-18 14:55:01 +00:00
As simple code editors, you can use Sublime Text or Visual Studio Code, or Kate (all of which are available on Linux).
2019-11-21 15:03:19 +00:00
2020-03-18 14:55:01 +00:00
Just in case, it is worth mentioning that CLion creates `build` path on its own, it also on its own selects `debug` for build type, for configuration it uses a version of CMake that is defined in CLion and not the one installed by you, and finally, CLion will use `make` to run build tasks instead of `ninja` . This is normal behaviour, just keep that in mind to avoid confusion.
2019-11-21 15:03:19 +00:00
2020-05-25 07:03:12 +00:00
## Writing Code {#writing-code}
2019-11-21 15:03:19 +00:00
2021-09-19 20:05:54 +00:00
The description of ClickHouse architecture can be found here: https://clickhouse.com/docs/en/development/architecture/
2019-11-21 15:03:19 +00:00
2021-09-19 20:05:54 +00:00
The Code Style Guide: https://clickhouse.com/docs/en/development/style/
2019-11-21 15:03:19 +00:00
2021-09-19 20:05:54 +00:00
Adding third-party libraries: https://clickhouse.com/docs/en/development/contrib/#adding-third-party-libraries
2021-07-05 21:05:12 +00:00
2021-09-19 20:05:54 +00:00
Writing tests: https://clickhouse.com/docs/en/development/tests/
2019-11-21 15:03:19 +00:00
2021-11-17 16:06:37 +00:00
List of tasks: https://github.com/ClickHouse/ClickHouse/issues?q=is%3Aopen+is%3Aissue+label%3Ahacktoberfest
2019-11-21 15:03:19 +00:00
2020-05-25 07:03:12 +00:00
## Test Data {#test-data}
2019-11-21 15:03:19 +00:00
2022-03-12 06:24:31 +00:00
Developing ClickHouse often requires loading realistic datasets. It is particularly important for performance testing. We have a specially prepared set of anonymized data of web analytics. It requires additionally some 3GB of free disk space. Note that this data is not required to accomplish most of the development tasks.
2019-11-21 15:03:19 +00:00
2020-03-21 04:11:51 +00:00
sudo apt install wget xz-utils
2019-11-21 15:03:19 +00:00
2021-09-22 00:22:57 +00:00
wget https://datasets.clickhouse.com/hits/tsv/hits_v1.tsv.xz
wget https://datasets.clickhouse.com/visits/tsv/visits_v1.tsv.xz
2019-11-21 15:03:19 +00:00
2020-03-21 04:11:51 +00:00
xz -v -d hits_v1.tsv.xz
xz -v -d visits_v1.tsv.xz
2019-11-21 15:03:19 +00:00
2020-03-21 04:11:51 +00:00
clickhouse-client
2020-04-30 18:19:18 +00:00
2020-04-25 17:02:32 +00:00
CREATE DATABASE IF NOT EXISTS test
2019-11-21 15:03:19 +00:00
2020-03-21 04:11:51 +00:00
CREATE TABLE test.hits ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, `ParsedParams.Key1` Array(String), `ParsedParams.Key2` Array(String), `ParsedParams.Key3` Array(String), `ParsedParams.Key4` Array(String), `ParsedParams.Key5` Array(String), `ParsedParams.ValueDouble` Array(Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree PARTITION BY toYYYYMM(EventDate) SAMPLE BY intHash32(UserID) ORDER BY (CounterID, EventDate, intHash32(UserID), EventTime);
2019-11-21 15:03:19 +00:00
2020-03-21 04:11:51 +00:00
CREATE TABLE test.visits ( CounterID UInt32, StartDate Date, Sign Int8, IsNew UInt8, VisitID UInt64, UserID UInt64, StartTime DateTime, Duration UInt32, UTCStartTime DateTime, PageViews Int32, Hits Int32, IsBounce UInt8, Referer String, StartURL String, RefererDomain String, StartURLDomain String, EndURL String, LinkURL String, IsDownload UInt8, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, PlaceID Int32, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), IsYandex UInt8, GoalReachesDepth Int32, GoalReachesURL Int32, GoalReachesAny Int32, SocialSourceNetworkID UInt8, SocialSourcePage String, MobilePhoneModel String, ClientEventTime DateTime, RegionID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RemoteIP UInt32, RemoteIP6 FixedString(16), IPNetworkID UInt32, SilverlightVersion3 UInt32, CodeVersion UInt32, ResolutionWidth UInt16, ResolutionHeight UInt16, UserAgentMajor UInt16, UserAgentMinor UInt16, WindowClientWidth UInt16, WindowClientHeight UInt16, SilverlightVersion2 UInt8, SilverlightVersion4 UInt16, FlashVersion3 UInt16, FlashVersion4 UInt16, ClientTimeZone Int16, OS UInt8, UserAgent UInt8, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, NetMajor UInt8, NetMinor UInt8, MobilePhone UInt8, SilverlightVersion1 UInt8, Age UInt8, Sex UInt8, Income UInt8, JavaEnable UInt8, CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, BrowserLanguage UInt16, BrowserCountry UInt16, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), Params Array(String), `Goals.ID` Array(UInt32), `Goals.Serial` Array(UInt32), `Goals.EventTime` Array(DateTime), `Goals.Price` Array(Int64), `Goals.OrderID` Array(String), `Goals.CurrencyID` Array(UInt32), WatchIDs Array(UInt64), ParamSumPrice Int64, ParamCurrency FixedString(3), ParamCurrencyID UInt16, ClickLogID UInt64, ClickEventID Int32, ClickGoodEvent Int32, ClickEventTime DateTime, ClickPriorityID Int32, ClickPhraseID Int32, ClickPageID Int32, ClickPlaceID Int32, ClickTypeID Int32, ClickResourceID Int32, ClickCost UInt32, ClickClientIP UInt32, ClickDomainID UInt32, ClickURL String, ClickAttempt UInt8, ClickOrderID UInt32, ClickBannerID UInt32, ClickMarketCategoryID UInt32, ClickMarketPP UInt32, ClickMarketCategoryName String, ClickMarketPPName String, ClickAWAPSCampaignName String, ClickPageName String, ClickTargetType UInt16, ClickTargetPhraseID UInt64, ClickContextType UInt8, ClickSelectType Int8, ClickOptions String, ClickGroupBannerID Int32, OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, FirstVisit DateTime, PredLastVisit Date, LastVisit Date, TotalVisits UInt32, `TraficSource.ID` Array(Int8), `TraficSource.SearchEngineID` Array(UInt16), `TraficSource.AdvEngineID` Array(UInt8), `TraficSource.PlaceID` Array(UInt16), `TraficSource.SocialSourceNetworkID` Array(UInt8), `TraficSource.Domain` Array(String), `TraficSource.SearchPhrase` Array(String), `TraficSource.SocialSourcePage` Array(String), Attendance FixedString(16), CLID UInt32, YCLID UInt64, NormalizedRefererHash UInt64, SearchPhraseHash UInt64, RefererDomainHash UInt64, NormalizedStartURLHash UInt64, StartURLDomainHash UInt64, NormalizedEndURLHash UInt64, TopLevelDomain UInt64, URLScheme UInt64, OpenstatServiceNameHash UInt64, OpenstatCampaignIDHash UInt64, OpenstatAdIDHash UInt64, OpenstatSourceIDHash UInt64, UTMSourceHash UInt64, UTMMediumHash UInt64, UTMCampaignHash UInt64, UTMContentHash UInt64, UTMTermHash UInt64, FromHash UInt64, WebVisorEnabled UInt8, WebVisorActivity UInt32, `ParsedParams.Key1` Array(String), `ParsedParams.Key2` Array(String), `ParsedParams.Key3` Array(String), `ParsedParams.Key4` Array(String), `ParsedParams.Key5` Array(String), `Par
2019-11-21 15:03:19 +00:00
2020-03-21 04:11:51 +00:00
clickhouse-client --max_insert_block_size 100000 --query "INSERT INTO test.hits FORMAT TSV" < hits_v1.tsv
clickhouse-client --max_insert_block_size 100000 --query "INSERT INTO test.visits FORMAT TSV" < visits_v1.tsv
2019-11-21 15:03:19 +00:00
2020-05-25 07:03:12 +00:00
## Creating Pull Request {#creating-pull-request}
2019-11-21 15:03:19 +00:00
2020-03-20 10:10:48 +00:00
Navigate to your fork repository in GitHub’ s UI. If you have been developing in a branch, you need to select that branch. There will be a “Pull request” button located on the screen. In essence, this means “create a request for accepting my changes into the main repository”.
2019-11-21 15:03:19 +00:00
2022-06-02 13:01:59 +00:00
A pull request can be created even if the work is not completed yet. In this case please put the word “WIP” (work in progress) at the beginning of the title, it can be changed later. This is useful for cooperative reviewing and discussion of changes as well as for running all of the available tests. It is important that you provide a brief description of your changes, it will later be used for generating release changelog.
2019-11-21 15:03:19 +00:00
2022-03-12 06:24:31 +00:00
Testing will commence as soon as ClickHouse employees label your PR with a tag “can be tested”. The results of some first checks (e.g. code style) will come in within several minutes. Build check results will arrive within half an hour. And the main set of tests will report itself within an hour.
2019-11-21 15:03:19 +00:00
2020-03-20 10:10:48 +00:00
The system will prepare ClickHouse binary builds for your pull request individually. To retrieve these builds click the “Details” link next to “ClickHouse build check” entry in the list of checks. There you will find direct links to the built .deb packages of ClickHouse which you can deploy even on your production servers (if you have no fear).
2019-11-21 15:03:19 +00:00
2020-03-18 14:55:01 +00:00
Most probably some of the builds will fail at first times. This is due to the fact that we check builds both with gcc as well as with clang, with almost all of existing warnings (always with the `-Werror` flag) enabled for clang. On that same page, you can find all of the build logs so that you do not have to build ClickHouse in all of the possible ways.
2022-07-05 12:24:00 +00:00
2022-07-31 13:01:35 +00:00
## Browse ClickHouse Source Code {#browse-clickhouse-source-code}
2022-07-24 19:03:43 +00:00
You can use the **Woboq** online code browser available [here ](https://clickhouse.com/codebrowser/ClickHouse/src/index.html ). It provides code navigation, semantic highlighting, search and indexing. The code snapshot is updated daily.
2022-10-09 00:54:00 +00:00
You can use GitHub integrated code browser [here ](https://github.dev/ClickHouse/ClickHouse ).
2022-07-05 12:24:00 +00:00
2022-10-09 00:54:00 +00:00
Also, you can browse sources on [GitHub ](https://github.com/ClickHouse/ClickHouse ) as usual.
2022-07-05 12:24:00 +00:00
If you are not interested in functionality provided by third-party libraries, you can further speed up the build using `cmake` options
```
-DENABLE_LIBRARIES=0 -DENABLE_EMBEDDED_COMPILER=0
```
In case of problems with any of the development options, you are on your own!