Get Started
This document describes how to build and run DatabendQuery as a distributed query engine.
1. Deploy
- Release binary(Recommended)
- Run with Docker
- From source
$ curl -fsS https://repo.databend.rs/databend/install-bendctl.sh | bash
$ export PATH="${HOME}/.databend/bin:${PATH}"
$ bendctl cluster create
$ docker pull datafuselabs/databend
$ docker run --init --rm -p 3307:3307 datafuselabs/databend
$ git clone https://github.com/datafuselabs/databend.git
$ cd databend && make setup
$ export PATH=$PATH:~/.cargo/bin
$ make run
2. Client
note
numbers(N) – A table for test with the single number
column (UInt64) that contains integers from 0 to N-1.
- bendctl
- MySQL Client
- ClickHouse Client
- HTTP Client
[local] [admin]> \sql
Mode switched to SQL query mode
[local] [sql]> SELECT avg(number) FROM numbers(1000000000);
+-------------+
| avg(number) |
+-------------+
| 499999999.5 |
+-------------+
[ok] read rows: 1,000,000,000, read bytes: 8.00 GB, rows/sec: 1,259,445,843 (rows/sec), bytes/sec: 10.07556675 (GB/sec)
[local] [sql]>
mysql -h127.0.0.1 -uroot -P3307
mysql> SELECT avg(number) FROM numbers(1000000000);
+-------------+
| avg(number) |
+-------------+
| 499999999.5 |
+-------------+
1 row in set (0.05 sec)
clickhouse client --host 0.0.0.0 --port 9000
databend :) SELECT avg(number) FROM numbers(1000000000);
SELECT avg(number)
FROM numbers(1000000000)
Query id: 89e06fba-1d57-464d-bfb0-238df85a2e66
┌─avg(number)─┐
│ 499999999.5 │
└─────────────┘
1 rows in set. Elapsed: 0.062 sec. Processed 1.00 billion rows, 8.01 GB (16.16 billion rows/s., 129.38 GB/s.)
curl --location --request POST '127.0.0.1:8001/v1/statement/' --header 'Content-Type: text/plain' --data-raw 'SELECT avg(number) FROM numbers(1000000000)'
{"id":"efca332b-13f4-4b8c-982d-cebf91626214","nextUri":null,"data":[[499999999.5]],"columns":{"fields":[{"name":"avg(number)","data_type":"Float64","nullable":false}],"metadata":{}},"error":null,"stats":{"read_rows":1000000000,"read_bytes":8000000000,"total_rows_to_read":0}}