Yingwen 281eae9f44 fix: Fix filtering out rows incorrectly during dedup phase (#484)
* fix: dedup should not mark element as unneeded

It should only mark element as selected, because some column of
different rows may have same value.

* refactor: Rename dedup to find_unique

As the original `dedup` method only mark bitmap to true when it finds
the element is unique, so `find_unique` is more appropriate for its
name.

* test: Renew bitmap in test_batch_find_unique

* chore: Update comments
2022-11-14 21:40:17 +08:00
2022-11-10 14:21:24 +08:00
2022-11-14 21:18:23 +08:00

GreptimeDB Logo

The next-generation hybrid timeseries/analytics processing database in the cloud

  CI  

 

What is GreptimeDB

GreptimeDB is an open-source time-series database with special focus on scalability, analytical capabilities and efficiency. It's designed to work on infrastructure of cloud era, and benefits from its elasticity and commodity storage.

The core developers of GreptimeDB have been building time-series data platform for years. Based on their best-practices, GreptimeDB is born to give you:

  • A standalone binary that scales to highly-available distributed cluster, with transparent experience from user's perspective
  • Columnar data layout optimised for time-series, compacted, compressed, stored on various storage backends
  • Flexible index options, tackling high cardinality issues down
  • Distributed parallel query execution, leveraging elastic computing resource
  • Native SQL, and Python scripting for advanced analytical scenarios
  • Widely adopted database protocols and APIs
  • Extensible table engine architecture for extensive workloads

Quick Start

Build

Build from Source

To compile GreptimeDB from source, you'll need:

  • C/C++ Toolchain: provides basic tools for compiling and linking. This is available as build-essential on ubuntu and similar name on other platforms.
  • Rust: the easiest way to install Rust is to use rustup, which will check our rust-toolchain file and install correct Rust version for you.
  • Protobuf: protoc is required for compiling .proto files. protobuf is available from major package manager on macos and linux distributions. You can find an installation instructions here.

Build with Docker

A docker image with necessary dependencies is provided:

docker build --network host -f docker/Dockerfile -t greptimedb .

Run

Start GreptimeDB from source code, in standalone mode:

cargo run -- standalone start

Or if you built from docker:

docker run -p 4002:4002 -v "$(pwd):/tmp/greptimedb" greptime/greptimedb standalone start

For more startup options, greptimedb's distributed mode and information about Kubernetes deployment, check our docs.

Connect

  1. Connect to GreptimeDB via standard MySQL client:

    # The standalone instance listen on port 4002 by default.
    mysql -h 127.0.0.1 -P 4002
    
  2. Create a database;

    CREATE DATABASE hello_greptime;
    
  3. Create table:

    CREATE TABLE hello_greptime.monitor (
      host STRING,
      ts TIMESTAMP,
      cpu DOUBLE DEFAULT 0,
      memory DOUBLE,
      TIME INDEX (ts),
      PRIMARY KEY(host)) ENGINE=mito WITH(regions=1);
    
  4. Insert data:

    INSERT INTO hello_greptime.monitor(host, cpu, memory, ts) VALUES ('host1', 66.6, 1024, 1660897955000);
    INSERT INTO hello_greptime.monitor(host, cpu, memory, ts) VALUES ('host2', 77.7, 2048, 1660897956000);
    INSERT INTO hello_greptime.monitor(host, cpu, memory, ts) VALUES ('host3', 88.8, 4096, 1660897957000);
    
  5. Query data:

    mysql> SELECT * FROM hello_greptime.monitor;
    +-------+---------------------+------+--------+
    | host  | ts                  | cpu  | memory |
    +-------+---------------------+------+--------+
    | host1 | 2022-08-19 08:32:35 | 66.6 |   1024 |
    | host2 | 2022-08-19 08:32:36 | 77.7 |   2048 |
    | host3 | 2022-08-19 08:32:37 | 88.8 |   4096 |
    +-------+---------------------+------+--------+
    3 rows in set (0.01 sec)
    

You can always cleanup test database by removing /tmp/greptimedb.

Resources

Community

The core team will be thrilled if you participate in any way you like. When you are stuck, try asking for help by filing an issue with a detailed description of what you were trying to do and what went wrong. If you have any questions or if you would like to get involved in our community, please check out:

In addition, you may:

Documentation

License

GreptimeDB uses the Apache 2.0 license to strike a balance between open contributions and allowing you to use the software however you want.

Contributing

Please refer to contribution guidelines for more information.

Description
Languages
Rust 99.6%
Shell 0.1%