mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge branch 'master' into refactoring
This commit is contained in:
commit
d7bb629195
@ -8,7 +8,12 @@
|
||||
# sudo apt-get install ninja-build
|
||||
|
||||
# CLion does not support Ninja
|
||||
if (NOT ${CMAKE_COMMAND} MATCHES "clion")
|
||||
# You can add your vote on CLion task tracker:
|
||||
# https://youtrack.jetbrains.com/issue/CPP-2659
|
||||
# https://youtrack.jetbrains.com/issue/CPP-870
|
||||
|
||||
string(TOLOWER "${CMAKE_COMMAND}" CMAKE_COMMAND_LOWER)
|
||||
if (NOT ${CMAKE_COMMAND_LOWER} MATCHES "clion")
|
||||
find_program(NINJA_PATH ninja)
|
||||
if (NINJA_PATH)
|
||||
set(CMAKE_GENERATOR "Ninja" CACHE INTERNAL "" FORCE)
|
||||
|
@ -76,6 +76,12 @@ class ClickHouseCluster:
|
||||
self.is_up = False
|
||||
|
||||
|
||||
def get_client_cmd(self):
|
||||
cmd = self.client_bin_path
|
||||
if p.basename(cmd) == 'clickhouse':
|
||||
cmd += " client"
|
||||
return cmd
|
||||
|
||||
def add_instance(self, name, config_dir=None, main_configs=[], user_configs=[], macros={}, with_zookeeper=False, with_mysql=False, with_kafka=False, clickhouse_path_dir=None, with_odbc_drivers=False, hostname=None, env_variables={}, image="ubuntu:14.04"):
|
||||
"""Add an instance to the cluster.
|
||||
|
||||
|
@ -67,20 +67,20 @@ def test_deduplication_works_in_case_of_intensive_inserts(started_cluster):
|
||||
inserters.append(CommandRequest(['/bin/bash'], timeout=10, stdin="""
|
||||
set -e
|
||||
for i in `seq 1000`; do
|
||||
clickhouse-client --host {} -q "INSERT INTO simple VALUES (0, 0)"
|
||||
{} --host {} -q "INSERT INTO simple VALUES (0, 0)"
|
||||
done
|
||||
""".format(host)))
|
||||
""".format(cluster.get_client_cmd(), host)))
|
||||
|
||||
fetchers.append(CommandRequest(['/bin/bash'], timeout=10, stdin="""
|
||||
set -e
|
||||
for i in `seq 1000`; do
|
||||
res=`clickhouse-client --host {} -q "SELECT count() FROM simple"`
|
||||
res=`{} --host {} -q "SELECT count() FROM simple"`
|
||||
if [[ $? -ne 0 || $res -ne 1 ]]; then
|
||||
echo "Selected $res elements! Host: {}" 1>&2
|
||||
exit -1
|
||||
fi;
|
||||
done
|
||||
""".format(host, node.name)))
|
||||
""".format(cluster.get_client_cmd(), host, node.name)))
|
||||
|
||||
# There were not errors during INSERTs
|
||||
for inserter in inserters:
|
||||
|
@ -50,7 +50,7 @@ def test_random_inserts(started_cluster):
|
||||
bash_script = os.path.join(os.path.dirname(__file__), "test.sh")
|
||||
inserters = []
|
||||
for node in nodes:
|
||||
cmd = ['/bin/bash', bash_script, node.ip_address, str(min_timestamp), str(max_timestamp)]
|
||||
cmd = ['/bin/bash', bash_script, node.ip_address, str(min_timestamp), str(max_timestamp), str(cluster.get_client_cmd())]
|
||||
inserters.append(CommandRequest(cmd, timeout=DURATION_SECONDS * 2, stdin=''))
|
||||
print node.name, node.ip_address
|
||||
|
||||
@ -60,7 +60,7 @@ def test_random_inserts(started_cluster):
|
||||
answer="{}\t{}\t{}\t{}\n".format(num_timestamps, num_timestamps, min_timestamp, max_timestamp)
|
||||
|
||||
for node in nodes:
|
||||
res = node.query("SELECT count(), uniqExact(i), min(i), max(i) FROM simple")
|
||||
res = node.query_with_retry("SELECT count(), uniqExact(i), min(i), max(i) FROM simple", check_callback=lambda res: TSV(res) == TSV(answer))
|
||||
assert TSV(res) == TSV(answer), node.name + " : " + node.query("SELECT groupArray(_part), i, count() AS c FROM simple GROUP BY i ORDER BY c DESC LIMIT 1")
|
||||
|
||||
node1.query("""DROP TABLE simple ON CLUSTER test_cluster""")
|
||||
|
@ -4,7 +4,7 @@
|
||||
[[ -n "$1" ]] && host="$1" || host="localhost"
|
||||
[[ -n "$2" ]] && min_timestamp="$2" || min_timestamp=$(( $(date +%s) - 60 ))
|
||||
[[ -n "$3" ]] && max_timestamp="$3" || max_timestamp=$(( $(date +%s) + 60 ))
|
||||
[[ -n "$4" ]] && iters_per_timestamp="$4" || iters_per_timestamp=5
|
||||
[[ -n "$4" ]] && client="$4" || client="clickhouse-client"
|
||||
|
||||
timestamps=`seq $min_timestamp $max_timestamp`
|
||||
|
||||
@ -18,7 +18,7 @@ function reliable_insert {
|
||||
fi
|
||||
|
||||
#echo clickhouse-client --host $host -q "INSERT INTO simple VALUES (0, $ts, '$ts')"
|
||||
res=`clickhouse-client --host $host -q "INSERT INTO simple VALUES (0, $ts, '$ts')" 2>&1`
|
||||
res=`$client --host $host -q "INSERT INTO simple VALUES (0, $ts, '$ts')" 2>&1`
|
||||
rt=$?
|
||||
num_tries=$(($num_tries+1))
|
||||
|
||||
|
@ -130,7 +130,7 @@ class Runner:
|
||||
|
||||
|
||||
def test_mutations(started_cluster):
|
||||
DURATION_SECONDS = 50
|
||||
DURATION_SECONDS = 30
|
||||
|
||||
runner = Runner()
|
||||
|
||||
@ -155,8 +155,8 @@ def test_mutations(started_cluster):
|
||||
assert runner.total_mutations > 0
|
||||
|
||||
all_done = False
|
||||
for i in range(100): # wait for replication 50 seconds max
|
||||
time.sleep(0.5)
|
||||
for i in range(100): # wait for replication 80 seconds max
|
||||
time.sleep(0.8)
|
||||
|
||||
def get_done_mutations(node):
|
||||
return int(node.query("SELECT sum(is_done) FROM system.mutations WHERE table = 'test_mutations'").rstrip())
|
||||
|
@ -52,4 +52,4 @@ FROM t_null
|
||||
└────────────┘
|
||||
|
||||
2 rows in set. Elapsed: 0.144 sec.
|
||||
``
|
||||
```
|
||||
|
@ -20,7 +20,7 @@ In a column-oriented DBMS, data is stored like this:
|
||||
|
||||
| Row: | #0 | #1 | #2 | #N |
|
||||
| ----------- | ------------------- | ------------------- | ------------------- | ------------------- |
|
||||
| WatchID: | 5385521489354350662 | 5385521490329509958 | 5385521489953706054 | ... |
|
||||
| WatchID: | 89354350662 | 90329509958 | 89953706054 | ... |
|
||||
| JavaEnable: | 1 | 0 | 1 | ... |
|
||||
| Title: | Investor Relations | Contact us | Mission | ... |
|
||||
| GoodEvent: | 1 | 1 | 1 | ... |
|
||||
@ -61,11 +61,11 @@ Column-oriented databases are better suited to OLAP scenarios: they are at least
|
||||
|
||||
**Row-oriented DBMS**
|
||||
|
||||
![Row-oriented ]( images/row_oriented.gif#)
|
||||
![Row-oriented](images/row_oriented.gif#)
|
||||
|
||||
**Column-oriented DBMS**
|
||||
|
||||
![Column-oriented](images / column_oriented.gif#)
|
||||
![Column-oriented](images/column_oriented.gif#)
|
||||
|
||||
See the difference?
|
||||
|
||||
|
@ -4,12 +4,12 @@ ClickHouse - столбцовая система управления базам
|
||||
|
||||
В обычной, "строковой" СУБД, данные хранятся в таком порядке:
|
||||
|
||||
| Строка | WatchID | JavaEnable | Title | GoodEvent | EventTime |
|
||||
| ------ | ------------------- | ---------- | ------------------ | --------- | ------------------- |
|
||||
| #0 | 5385521489354350662 | 1 | Investor Relations | 1 | 2016-05-18 05:19:20 |
|
||||
| #1 | 5385521490329509958 | 0 | Contact us | 1 | 2016-05-18 08:10:20 |
|
||||
| #2 | 5385521489953706054 | 1 | Mission | 1 | 2016-05-18 07:38:00 |
|
||||
| #N | ... | ... | ... | ... | ... |
|
||||
| Строка | WatchID | JavaEnable | Title | GoodEvent | EventTime |
|
||||
| ------ | ----------- | ---------- | ------------------ | --------- | ------------------- |
|
||||
| #0 | 89354350662 | 1 | Investor Relations | 1 | 2016-05-18 05:19:20 |
|
||||
| #1 | 90329509958 | 0 | Contact us | 1 | 2016-05-18 08:10:20 |
|
||||
| #2 | 89953706054 | 1 | Mission | 1 | 2016-05-18 07:38:00 |
|
||||
| #N | ... | ... | ... | ... | ... |
|
||||
|
||||
То есть, значения, относящиеся к одной строке, физически хранятся рядом.
|
||||
|
||||
@ -20,7 +20,7 @@ ClickHouse - столбцовая система управления базам
|
||||
|
||||
| Строка: | #0 | #1 | #2 | #N |
|
||||
| ----------- | ------------------- | ------------------- | ------------------- | ------------------- |
|
||||
| WatchID: | 5385521489354350662 | 5385521490329509958 | 5385521489953706054 | ... |
|
||||
| WatchID: | 89354350662 | 90329509958 | 89953706054 | ... |
|
||||
| JavaEnable: | 1 | 0 | 1 | ... |
|
||||
| Title: | Investor Relations | Contact us | Mission | ... |
|
||||
| GoodEvent: | 1 | 1 | 1 | ... |
|
||||
|
@ -26,7 +26,7 @@ var paths = {
|
||||
docstxt: ['docs/**/*.txt', 'docs/redirects.conf'],
|
||||
docsjson: ['docs/**/*.json'],
|
||||
docsxml: ['docs/**/*.xml'],
|
||||
docssitemap: ['sitemap.xml'],
|
||||
docssitemap: ['sitemap.xml', 'sitemap_static.xml'],
|
||||
scripts: [
|
||||
'**/*.js',
|
||||
'!gulpfile.js',
|
||||
|
@ -1,8 +1,10 @@
|
||||
User-agent: *
|
||||
Disallow: /docs/en/single/
|
||||
Disallow: /docs/ru/single/
|
||||
Disallow: /docs/fa/single/
|
||||
Disallow: /docs/en/search.html
|
||||
Disallow: /docs/ru/search.html
|
||||
Disallow: /docs/fa/search.html
|
||||
Disallow: /deprecated/reference_en.html
|
||||
Disallow: /deprecated/reference_ru.html
|
||||
Allow: /
|
||||
|
@ -1,10 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<sitemap>
|
||||
<loc>https://clickhouse.yandex/docs/en/sitemap.xml</loc>
|
||||
</sitemap>
|
||||
<sitemap>
|
||||
<loc>https://clickhouse.yandex/docs/ru/sitemap.xml</loc>
|
||||
</sitemap>
|
||||
<sitemap>
|
||||
<loc>https://clickhouse.yandex/docs/en/sitemap.xml</loc>
|
||||
<loc>https://clickhouse.yandex/docs/fa/sitemap.xml</loc>
|
||||
</sitemap>
|
||||
<sitemap>
|
||||
<loc>https://clickhouse.yandex/docs/sitemap_static.xml</loc>
|
||||
|
Loading…
Reference in New Issue
Block a user