This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bohu@thinkpad:~/github/cppwork/ClickHouse/build$ ./programs/clickhouse client | |
ClickHouse client version 21.9.1.1. | |
Connecting to localhost:9000 as user default. | |
Connected to datafuse server version 2021.5.0 revision 54405. | |
ClickHouse client version is older than ClickHouse server. It may lack support for new features. | |
datafuse :) SELECT avg(number) FROM numbers_mt(100000000000) | |
SELECT avg(number) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thread 'rustc' panicked at 'assertion failed: `(left == right)` | |
left: `Some(Fingerprint(212923312148573672, 18320173992410164289))`, | |
right: `Some(Fingerprint(8537439170242672706, 4648092694241280842))`: found unstable fingerprints for evaluate_obligation(743076f0f8113f2e-37da7c23f6b6e546): Ok(EvaluatedToOkModuloRegions)', /rustc/bacf770f2983a52f31e3537db5f0fe1ef2eaa874/compiler/rustc_query_system/src/query/plumbing.rs:585:5 | |
stack backtrace: | |
0: rust_begin_unwind | |
at /rustc/bacf770f2983a52f31e3537db5f0fe1ef2eaa874/library/std/src/panicking.rs:493:5 | |
1: core::panicking::panic_fmt | |
at /rustc/bacf770f2983a52f31e3537db5f0fe1ef2eaa874/library/core/src/panicking.rs:92:14 | |
2: core::panicking::assert_failed_inner | |
3: core::panicking::assert_failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClickHouse client version 21.4.6.55 (official build). | |
Connecting to localhost:9000 as user default. | |
Connected to datafuse server version 2021.5.0 revision 54405. | |
ClickHouse client version is older than ClickHouse server. It may lack support for new features. | |
datafuse :) | |
SET max_threads = 16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClickHouse client version 21.4.6.55 (official build). | |
Connecting to localhost:9000 as user default. | |
Connected to ClickHouse server version 21.4.6 revision 54447. | |
thinkpad :) set max_threads=16; | |
SET max_threads = 16 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"time" | |
"context" | |
"database/sql" | |
_ "github.com/go-sql-driver/mysql" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. docker mysql | |
sudo docker run -d -e MYSQL_ROOT_PASSWORD=123 mysql:5.7 mysqld --datadir=/var/lib/mysql --server-id=1 --log-bin=/var/lib/mysql/mysql-bin.log --gtid-mode=ON --enforce-gtid-consistency --disable-ssl --ssl=0 | |
2. bench progoram | |
$ mkdir bench | |
$ mkdir bench/src | |
$ vim bench/src/run.go | |
``` | |
package main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. install the GTID based replication ClickHouse | |
1.1 build from the master | |
1.2 download from https://clickhouse-builds.s3.yandex.net/0/cff92c8ad3dea2d96b1dfaadc76c3c10b3d701b2/clickhouse_build_check/report.html | |
2. prepare MySQL with GTID | |
2.1 $docker run -d -e MYSQL_ROOT_PASSWORD=123 mysql:5.7 mysqld --datadir=/var/lib/mysql --server-id=1 --log-bin=/var/lib/mysql/mysql-bin.log --gtid-mode=ON --enforce-gtid-consistency | |
2.2 mysql> create database sbtest; | |
3. run sysbench prepare | |
$docker run --rm=true --name=sb-prepare severalnines/sysbench sysbench --db-driver=mysql --oltp-table-size=100 --oltp-tables-count=4 --threads=1 --mysql-host=172.17.0.2 --mysql-port=3306 --mysql-user=root --mysql-password=123 /usr/share/sysbench/tests/include/oltp_legacy/oltp.lua prepare |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- copy from https://github.com/Altinity/clickhouse-mysql-data-reader/blob/master/docs/manual.md#mysql-data-types | |
RESET MASTER; | |
DROP DATABASE IF EXISTS dbtest; | |
CREATE DATABASE dbtest; | |
USE dbtest; | |
CREATE TABLE datatypes( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
class JavaConnectorTest { | |
private static final String CREATE_TABLE_SQL = "CREATE TABLE IF NOT EXISTS default.test1 (age Int32, name String) Engine = Memory"; | |
private static final String INSERT_SQL = "INSERT INTO default.test1 VALUES(33, 'jdbc'),(44, 'ck')"; |