Skip to content

Commit ec8cf03

Browse files
authored
Merge branch 'master' into fix-read-settings-in-index-loading
2 parents f337fef + 95f0ca2 commit ec8cf03

File tree

201 files changed

+4351
-1856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+4351
-1856
lines changed

CHANGELOG.md

Lines changed: 48 additions & 54 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Upcoming meetups
4545
* [Jakarta Meetup](https://www.meetup.com/clickhouse-indonesia-user-group/events/303191359/) - October 1
4646
* [Singapore Meetup](https://www.meetup.com/clickhouse-singapore-meetup-group/events/303212064/) - October 3
4747
* [Madrid Meetup](https://www.meetup.com/clickhouse-spain-user-group/events/303096564/) - October 22
48-
* [Barcelona Meetup](https://www.meetup.com/clickhouse-spain-user-group/events/303096876/) - October 29
4948
* [Oslo Meetup](https://www.meetup.com/open-source-real-time-data-warehouse-real-time-analytics/events/302938622) - October 31
49+
* [Barcelona Meetup](https://www.meetup.com/clickhouse-spain-user-group/events/303096876/) - November 12
5050
* [Ghent Meetup](https://www.meetup.com/clickhouse-belgium-user-group/events/303049405/) - November 19
5151
* [Dubai Meetup](https://www.meetup.com/clickhouse-dubai-meetup-group/events/303096989/) - November 21
5252
* [Paris Meetup](https://www.meetup.com/clickhouse-france-user-group/events/303096434) - November 26

cmake/dbms_glob_sources.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ macro(add_headers_only prefix common_path)
1212
add_glob(${prefix}_headers ${common_path}/*.h)
1313
endmacro()
1414

15+
# Assumes the path is under src and that src/ needs to be removed (valid for any subdirectory under src/)
1516
macro(extract_into_parent_list src_list dest_list)
1617
list(REMOVE_ITEM ${src_list} ${ARGN})
17-
get_filename_component(__dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
18+
file(RELATIVE_PATH relative ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
19+
string(REPLACE "src/" "" relative ${relative})
1820
foreach(file IN ITEMS ${ARGN})
19-
list(APPEND ${dest_list} ${__dir_name}/${file})
21+
list(APPEND ${dest_list} ${relative}/${file})
2022
endforeach()
2123
set(${dest_list} "${${dest_list}}" PARENT_SCOPE)
2224
endmacro()

contrib/mongo-c-driver-cmake/CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ set(LIBBSON_SOURCES_ROOT "${ClickHouse_SOURCE_DIR}/contrib/mongo-c-driver/src")
1717
set(LIBBSON_SOURCE_DIR "${LIBBSON_SOURCES_ROOT}/libbson/src")
1818
file(GLOB_RECURSE LIBBSON_SOURCES "${LIBBSON_SOURCE_DIR}/*.c")
1919

20+
set(LIBBSON_BINARY_ROOT "${ClickHouse_BINARY_DIR}/contrib/mongo-c-driver/src")
21+
set(LIBBSON_BINARY_DIR "${LIBBSON_BINARY_ROOT}/libbson/src")
22+
2023
include(TestBigEndian)
2124
test_big_endian(BSON_BIG_ENDIAN)
2225
if(BSON_BIG_ENDIAN)
@@ -98,16 +101,11 @@ set(MONGOC_HAVE_SS_FAMILY 0)
98101

99102
configure_file(
100103
${LIBBSON_SOURCE_DIR}/bson/bson-config.h.in
101-
${LIBBSON_SOURCE_DIR}/bson/bson-config.h
104+
${LIBBSON_BINARY_DIR}/bson/bson-config.h
102105
)
103106
configure_file(
104107
${LIBBSON_SOURCE_DIR}/bson/bson-version.h.in
105-
${LIBBSON_SOURCE_DIR}/bson/bson-version.h
106-
)
107-
108-
configure_file(
109-
${LIBBSON_SOURCE_DIR}/bson/bson-version.h.in
110-
${LIBBSON_SOURCE_DIR}/bson/bson-version.h
108+
${LIBBSON_BINARY_DIR}/bson/bson-version.h
111109
)
112110

113111
set(COMMON_SOURCE_DIR "${LIBBSON_SOURCES_ROOT}/common")
@@ -118,7 +116,7 @@ configure_file(
118116
)
119117
add_library(_libbson ${LIBBSON_SOURCES} ${COMMON_SOURCES})
120118
add_library(ch_contrib::libbson ALIAS _libbson)
121-
target_include_directories(_libbson SYSTEM PUBLIC ${LIBBSON_SOURCE_DIR} ${COMMON_SOURCE_DIR})
119+
target_include_directories(_libbson SYSTEM PUBLIC ${LIBBSON_SOURCE_DIR} ${LIBBSON_BINARY_DIR} ${COMMON_SOURCE_DIR})
122120
target_compile_definitions(_libbson PRIVATE BSON_COMPILATION)
123121
if(OS_LINUX)
124122
target_compile_definitions(_libbson PRIVATE -D_GNU_SOURCE -D_POSIX_C_SOURCE=199309L -D_XOPEN_SOURCE=600)

docs/en/getting-started/example-datasets/star-schema.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
---
22
slug: /en/getting-started/example-datasets/star-schema
33
sidebar_label: Star Schema Benchmark
4-
description: "Dataset based on the TPC-H dbgen source. The coding style and architecture follows the TPCH dbgen."
4+
description: "The Star Schema Benchmark (SSB) data set and queries"
55
---
66

77
# Star Schema Benchmark (SSB, 2009)
88

9-
The Star Schema Benchmark is roughly based on the TPC-H tables and queries but unlike TPC-H, it uses a star schema layout.
9+
The Star Schema Benchmark is roughly based on the [TPC-H](tpch.md)'s tables and queries but unlike TPC-H, it uses a star schema layout.
1010
The bulk of the data sits in a gigantic fact table which is surrounded by multiple small dimension tables.
1111
The queries joined the fact table with one or more dimension tables to apply filter criteria, e.g. `MONTH = 'JANUARY'`.
1212

1313
References:
14-
[Star Schema Benchmark](https://cs.umb.edu/~poneil/StarSchemaB.pdf) (O'Neil et. al), 2009
15-
[Variations of the Star Schema Benchmark to Test the Effects of Data Skew on Query Performance](https://doi.org/10.1145/2479871.2479927) (Rabl. et. al.), 2013
16-
17-
14+
- [Star Schema Benchmark](https://cs.umb.edu/~poneil/StarSchemaB.pdf) (O'Neil et. al), 2009
15+
- [Variations of the Star Schema Benchmark to Test the Effects of Data Skew on Query Performance](https://doi.org/10.1145/2479871.2479927) (Rabl. et. al.), 2013
1816

1917
First, checkout the star schema benchmark repository and compile the data generator:
18+
2019
``` bash
21-
$ git clone https://github.com/vadimtk/ssb-dbgen.git
22-
$ cd ssb-dbgen
23-
$ make
20+
git clone https://github.com/vadimtk/ssb-dbgen.git
21+
cd ssb-dbgen
22+
make
2423
```
2524

26-
Then, generate the data. Parameter `-s` specifies the scale factor. For example, with `-s 100`, 600 million rows (67 GB) are generated.
25+
Then, generate the data. Parameter `-s` specifies the scale factor. For example, with `-s 100`, 600 million rows are generated.
2726

2827
``` bash
29-
$ ./dbgen -s 1000 -T c
30-
$ ./dbgen -s 1000 -T l
31-
$ ./dbgen -s 1000 -T p
32-
$ ./dbgen -s 1000 -T s
33-
$ ./dbgen -s 1000 -T d
28+
./dbgen -s 1000 -T c
29+
./dbgen -s 1000 -T l
30+
./dbgen -s 1000 -T p
31+
./dbgen -s 1000 -T s
32+
./dbgen -s 1000 -T d
3433
```
3534

3635
Now create tables in ClickHouse:
@@ -123,11 +122,11 @@ ENGINE = MergeTree ORDER BY D_DATEKEY;
123122
The data can be imported as follows:
124123

125124
``` bash
126-
$ clickhouse-client --query "INSERT INTO customer FORMAT CSV" < customer.tbl
127-
$ clickhouse-client --query "INSERT INTO part FORMAT CSV" < part.tbl
128-
$ clickhouse-client --query "INSERT INTO supplier FORMAT CSV" < supplier.tbl
129-
$ clickhouse-client --query "INSERT INTO lineorder FORMAT CSV" < lineorder.tbl
130-
$ clickhouse-client --query "INSERT INTO date FORMAT CSV" < date.tbl
125+
clickhouse-client --query "INSERT INTO customer FORMAT CSV" < customer.tbl
126+
clickhouse-client --query "INSERT INTO part FORMAT CSV" < part.tbl
127+
clickhouse-client --query "INSERT INTO supplier FORMAT CSV" < supplier.tbl
128+
clickhouse-client --query "INSERT INTO lineorder FORMAT CSV" < lineorder.tbl
129+
clickhouse-client --query "INSERT INTO date FORMAT CSV" < date.tbl
131130
```
132131

133132
In many use cases of ClickHouse, multiple tables are converted into a single denormalized flat table.
@@ -183,7 +182,7 @@ INNER JOIN supplier AS s ON s.S_SUPPKEY = l.LO_SUPPKEY
183182
INNER JOIN part AS p ON p.P_PARTKEY = l.LO_PARTKEY;
184183
```
185184

186-
Running the queries:
185+
The queries are generated by `./qgen -s <scaling_factor>`. Example queries for `s = 100`:
187186

188187
Q1.1
189188

0 commit comments

Comments
 (0)