GithubHelp home page GithubHelp logo

greptimeteam / greptimedb Goto Github PK

View Code? Open in Web Editor NEW
3.8K 3.8K 271.0 31.73 MB

An open-source, cloud-native, distributed time-series database with PromQL/SQL/Python supported. Available on GreptimeCloud.

Home Page: https://greptime.com/

License: Apache License 2.0

Rust 99.72% Dockerfile 0.09% Shell 0.08% HTML 0.01% Makefile 0.08% Python 0.03%
analytics cloud-native database distributed iot metrics monitoring rust sql time-series timeseries tsdb

greptimedb's People

Contributors

daviderli614 avatar dependabot[bot] avatar devilexilesu avatar dimbtp avatar discord9 avatar e1ijah1 avatar etolbakov avatar evenyag avatar fengjiachun avatar fengys1996 avatar haohuaijin avatar killme2008 avatar lizhemingi avatar michaelscofield avatar niebayes avatar niwakadev avatar paomian avatar quenkar avatar shuiyisong avatar sunng87 avatar taylor-lagrange avatar tisonkun avatar v0y4g3r avatar waynexia avatar wenyxu avatar xtang avatar yuanbohan avatar zhongzc avatar zonahex avatar zyy17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

greptimedb's Issues

Frontend v0.1

  • server
    • mysql server
    • mqtt server (publish end)
    • current http and grpc server refactor
    • graceful shutdown
  • execution
    • Frontend Instance
  • instance
    • influxdb write
    • opentsdb write
    • prom push instance
    • mqtt instance (publish end)
  • session
    • session abstraction
    • basic connection and session management

Frontend impl notes

potential concurrency hazard in `create_region`

Currently in file engine.rs line 166

manifest
    .update(RegionMetaAction::Change(RegionChange {
        metadata: Arc::new(metadata),
    }))
    .await?;

It should be executed when write lock is acquired and the region existance is checked below, otherwise the update action might be added more than once.

[RFC] Python Coprocessor

Summary

Coprocessor, as in TiDB and HBase or Stored Procedure in SQL, is a method to analyze data in local database and send it to remote node instead of send all data to remote node(and let remote do the analysis).
By using Coprocessor one can remove unnecessary communication cost and offload some computation to local node.
A Coprocessor using Python grammar can be much more friendly and customizable.

Detailed Explanation

By using this rustpython project, a Python virtual machine can be embedded in the database system itself, this virtual machine can take any RecordBatch (which is essentially a wrapper for a Vec of Arc<dyn arrow::array::Array>) and cast it to a list of readonly PyVector(a custom type that impl some of the Python type's function). Also using a embedded vm means no unnecessary copy overhead will be introduce.
Then allow user to write a user-define-function in Python to compute and build a new PyVector.
A short example can be like this:

@coprocessor(args=["cpu", "mem"], returns=["overheat"])
def measure(cpu: vector, mem: vector):
    overheat = (cpu > 75) & (mem > 60) # construct a new `PyVector<Bool>`
    # here can also contains more complicated code i.e. complex predicates and branches etc.
    return overheat  

Then the Vec<PyVector> can be cast back to RecordBatch and send for its original destination.
rfc流程图 drawio

Possible Optimization

The Python Virtual Machines can be replace by directly compile to logical plan and execute therefore remove overhead of python virtual machine

.

Tracking Issue for `StorageEngine::open_region()`

This is a tracking issue for implementing the StorageEngine::open_region() method.

Tasks

  • Adds RegionImpl::open() to open and recover a region
    • Code skeleton @evenyag #120
    • RegionImpl::recover_from_manifest() Loads metadata from manifest and construct Version @killme2008 #127
      • RegionManifest::load() should also load VersionEdit
      • RegionManifest::update() should persist metadata of Version(flushed_sequence)
    • Replay data from wal
      • Reads logstore and decode wal entry, implement Wal::decode_entry() @fengjiachun #123
      • RegionWriter::replay() replay batch into memtable, maintains Version @evenyag #135
    • Adds an option to OpenOptions to create region if it is absent (optional feature)
  • Manifest uses prev_version to construct the metadata change list (optional feature) @killme2008
  • Remove id from Namespace of logstore #120
    • Also remove region_id from Wal::new() #120
  • Concurrent control of opening/creating region #120
    • Related issue is #113
    • Maybe we should introduce state (enum) for region
  • Implements LogStore::read() @v0y4g3r #124
  • Add tests for open @evenyag #135

Related Tasks

  • We may also need to add a TableEngine::open_table() method to open all regions of this table #117
  • Support dynamic polymorphism for TableEngine #119

failed to query when using where with string column.

For example, create a table:

CREATE TABLE monitor (
  host STRING,
  ts BIGINT,
  cpu DOUBLE DEFAULT 0,
  memory DOUBLE,
  TIME INDEX (ts),
  PRIMARY KEY(ts,host)) ENGINE=mito WITH(regions=1);

The host is a string type column, then query with it:

 select * from monitor where host='host1';

An unexpected error raises:

2022-09-01T14:49:09.560207Z ERROR datanode::instance: Instance failed to execute sql err.msg=Failed to execute sql, source: Fail to optimize logical plan: Error during planning: 'LargeUtf8 = Int64' can't be evaluated because there isn't a common type to coerce the types to err.code=EngineExecuteQuery err.source=Fail to optimize logical plan: Error during planning: 'LargeUtf8 = Int64' can't be evaluated because there isn't a common type to coerce the types to err.source.sources=[Error during planning: 'LargeUtf8 = Int64' can't be evaluated because there isn't a common type to coerce the types to] err.backtrace= 0 <query::datafusion::DatafusionQueryEngine as query::logical_optimizer::LogicalOptimizer>::optimize_logical_plan::h47ac92e2abd152e3
 1 <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h511a220eeaee9ed6
 2 <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hfbff3155515a0e51
 3 <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hf15ce52f110e447e
 4 <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h502fad97e0437b69
 5 opensrv_mysql::AsyncMysqlIntermediary<B,S>::run_with_options::{{closure}}::h055a1e2bd21e0bda
 6 <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h38751b265a7703a3
 7 tokio::runtime::task::core::CoreStage<T>::poll::h3ba12fd99da727e8
 8 tokio::runtime::task::harness::Harness<T,S>::poll::h97658d329b43cfee
 9 std::thread::local::LocalKey<T>::with::h4dabc0538a69d83f
10 tokio::runtime::thread_pool::worker::Context::run_task::h407a31d514f84cae
11 tokio::runtime::thread_pool::worker::Context::run::hc6c306586049dbf1
12 tokio::macros::scoped_tls::ScopedKey<T>::set::h3e6a46fa3f2ff203
13 tokio::runtime::thread_pool::worker::run::hd7187524c1040448
14 <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll::hd9cdd72418271872
15 tokio::runtime::task::harness::Harness<T,S>::poll::h72fcf2af1ae977cb
16 tokio::runtime::blocking::pool::Inner::run::hcd03502d60e27b3c
17 std::sys_common::backtrace::__rust_begin_short_backtrace::h38905e9ee6087419
18 core::ops::function::FnOnce::call_once{{vtable.shim}}::h2ec75eeefbbc7511
19 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd07e28af8edcddb3
   /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/alloc/src/boxed.rs:1934
   <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf847a5de43751283
   /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/alloc/src/boxed.rs:1934
   std::sys::unix::thread::Thread::new::thread_start::hf754d6efd465ae0a
   /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/sys/unix/thread.rs:108

Implement `create_table` for `MitoEngine`

Now the MitoEngine only support creating a fixed schema demo table, to really create a table, we need to create related regions using given CreateTableRequest.

  • Parse CreateTableRequest, converting into RegionDescriptor
  • Creating related regions for this table
  • Support CREATE IF NOT EXISTS
  • Concurrency control

2022/05 todo

  • sql planner
  • http server for datanode
  • refactor errors
  • metric/log/tracing
  • config #156
  • impl more datatypes
  • storage layer design
  • storage poc #107
  • udf poc

Respect user defined schema columns order

When user creates a table as below:

create table system_metrics (
       ts bigint not null,
       cpu double default 0,
       memory double default 0,
       host string not null,
       TIME INDEX (ts),
       PRIMARY KEY(host, ts),
) engine = mito;

Then insert rows into table without explict columns or select * from table, the returned columns order is not the same with the order in schema:

mysql> insert into system_metrics values(1, 1, 1, "host");
ERROR 1815 (HY000): Failed to execute query: insert into system_metrics values(1, 1, 1, "host"), error: Fail to parse value: Fail to parse number 1, invalid column type: String(StringType),  0 backtrace::backtrace::libunwind::trace::he3753a2cc7e286f2
   /Users/dennis/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/libunwind.rs:93
   backtrace::backtrace::trace_unsynchronized::h6240cb34eea3df7e
   /Users/dennis/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/mod.rs:
mysql> select * from system_metrics;
+-------+---------------+------+--------+
| host  | ts            | cpu  | memory |
+-------+---------------+------+--------+
| host1 | 1660718928811 | 71.5 |   1024 |
| host2 | 1660718928812 | 61.8 |   4096 |
| host3 | 1660718928813 | 99.9 |  512.5 |
+-------+---------------+------+--------+

UDAF(User Defined Aggregated Function) implementation

  • Transplant DataFusion's UDAF related structs, traits and functions, like AggregateUDF, Accumulator or create_udaf etc.
  • Implement Median function (like influxdb's) on top of it (but only works for i32 datatype)
  • Rewrite UDAF functions definition using advanced type Rust metioned in skyzh/type-exercise-in-rust, so to make UDAF functions fit more datatypes.
  • Move median to src
  • Add UDAF register interface
  • Add "how to" documents

LocalFileLogStore always overwrite entry id

LocalFileLogStore has an internal entry id and always use that id to encode the entry, overwriting the id set by the user.

See file.rs

let mut file = self.file.write().await;
// generate entry id
entry_id = self.inc_entry_id();
// rewrite encoded data
LittleEndian::write_u64(&mut serialized[0..8], entry_id);

Our storage engine requires setting the entry id to store the sequence of the region.

feat: Scan supports merge and dedup

We need to implement a MergeReader to sort the input batches from multiple data sources (memtables, SSTs), and a DedupReader to only retain the row with latest sequence, for same row key.

This job would be break down into multiple PRs:

  • Support building a new Batch from parts of another Batch #215
  • Implement the MergeReader #225
  • Support dedup and filter the Vector #245
  • Implement the DedupReader #270

Unexpected behavior when calling a script

When calling a python script,there were some log looks strange:

022-09-08T02:45:40.549040Z  INFO rustpython_vm::frame: Exception raised: PyBaseException with cause: None
2022-09-08T02:45:40.563370Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:40.563434Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:40.566368Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:40.566423Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:40.575259Z  INFO rustpython_vm::frame: Exception raised: PyBaseException with cause: None
2022-09-08T02:45:40.578054Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:40.578102Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:40.583179Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:40.583235Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:52.818621Z  INFO rustpython_vm::frame: Exception raised: PyBaseException with cause: None
2022-09-08T02:45:52.831254Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:52.831346Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:52.833919Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:52.833969Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:52.843423Z  INFO rustpython_vm::frame: Exception raised: PyBaseException with cause: None
2022-09-08T02:45:52.846139Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:52.846197Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:52.851115Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object
2022-09-08T02:45:52.851171Z  WARN rustpython_vm::object::core: couldn't run __del__ method for object

And we can't exit the datanode process by CTRL + C.

Build fail, complains `libssl-dev` is required

Looks like ssl-dev should also be installed in order to compile project.

cargo tree shows that axum-test-helper introduces this dependency.

│   [dev-dependencies]
│   ├── arrow2 v0.10.1 (*)
│   ├── axum-test-helper v0.1.0
│   │   ├── axum v0.5.4 (*)
│   │   ├── bytes v1.1.0
│   │   ├── http v0.2.7 (*)
│   │   ├── http-body v0.4.4 (*)
│   │   ├── hyper v0.14.18 (*)
│   │   ├── reqwest v0.11.10
│   │   │   ├── base64 v0.13.0
│   │   │   ├── bytes v1.1.0
│   │   │   ├── encoding_rs v0.8.31
│   │   │   │   └── cfg-if v1.0.0
│   │   │   ├── futures-core v0.3.21
│   │   │   ├── futures-util v0.3.21 (*)
│   │   │   ├── h2 v0.3.13 (*)
│   │   │   ├── http v0.2.7 (*)
│   │   │   ├── http-body v0.4.4 (*)
│   │   │   ├── hyper v0.14.18 (*)
│   │   │   ├── hyper-tls v0.5.0
│   │   │   │   ├── bytes v1.1.0
│   │   │   │   ├── hyper v0.14.18 (*)
│   │   │   │   ├── native-tls v0.2.10
│   │   │   │   │   ├── log v0.4.17 (*)
│   │   │   │   │   ├── openssl v0.10.40
│   │   │   │   │   │   ├── bitflags v1.3.2
│   │   │   │   │   │   ├── cfg-if v1.0.0
│   │   │   │   │   │   ├── foreign-types v0.3.2
│   │   │   │   │   │   │   └── foreign-types-shared v0.1.1
│   │   │   │   │   │   ├── libc v0.2.125
│   │   │   │   │   │   ├── once_cell v1.12.0
│   │   │   │   │   │   ├── openssl-macros v0.1.0 (proc-macro)
│   │   │   │   │   │   │   ├── proc-macro2 v1.0.38 (*)
│   │   │   │   │   │   │   ├── quote v1.0.18 (*)
│   │   │   │   │   │   │   └── syn v1.0.92 (*)
│   │   │   │   │   │   └── openssl-sys v0.9.73
│   │   │   │   │   │       └── libc v0.2.125
│   │   │   │   │   │       [build-dependencies]
│   │   │   │   │   │       ├── autocfg v1.1.0
│   │   │   │   │   │       ├── cc v1.0.73 (*)
│   │   │   │   │   │       └── pkg-config v0.3.25
│   │   │   │   │   ├── openssl-probe v0.1.5
│   │   │   │   │   └── openssl-sys v0.9.73 (*)
➜  greptimedb git:(develop) cargo build
   Compiling futures-util v0.3.21
   Compiling serde v1.0.137
   Compiling tracing v0.1.34
   Compiling pin-project v1.0.10
   Compiling async-stream v0.3.3
   Compiling thiserror v1.0.31
   Compiling multiversion v0.6.1
   Compiling bytemuck v1.9.1
   Compiling metrics v0.18.1
   Compiling prost v0.10.4
   Compiling comfy-table v5.0.1
   Compiling minstant v0.1.1
   Compiling openssl-sys v0.9.73
error: failed to run custom build command for `openssl-sys v0.9.73`

Caused by:
  process didn't exit successfully: `/root/greptimedb/target/debug/build/openssl-sys-e994e97e79b04cea/build-script-main` (exit status: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: "Could not run `\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"`\nThe pkg-config command could not be found.\n\nMost likely, you need to install a pkg-config package for your OS.\nTry `apt install pkg-config`, or `yum install pkg-config`,\nor `pkg install pkg-config` depending on your distribution.\n\nIf you've already installed it, ensure the pkg-config command is one of the\ndirectories in the PATH environment variable.\n\nIf you did not expect this build to link to a pre-installed system library,\nthen check documentation of the openssl-sys crate for an option to\nbuild the library from source, or disable features or dependencies\nthat require pkg-config."

  --- stderr
  thread 'main' panicked at '

  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-unknown-linux-gnu
  $TARGET = x86_64-unknown-linux-gnu
  openssl-sys = 0.9.73


  It looks like you're compiling on Linux and also targeting Linux. Currently this
  requires the `pkg-config` utility to find OpenSSL but unfortunately `pkg-config`
  could not be found. If you have OpenSSL installed you can likely fix this by
  installing `pkg-config`.

  ', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.73/build/find_normal.rs:191:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

build: failed to run custom build command for `prost-build v0.10.4`

The latest develop branch requires cmake to be installed.

   Compiling prost v0.10.4
error: failed to run custom build command for `prost-build v0.10.4`

Caused by:
  process didn't exit successfully: `/Users/evenyag/codes/greptime/greptimedb/target/debug/build/prost-build-f1f8a74157e994cd/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake
  CMAKE_TOOLCHAIN_FILE_aarch64-apple-darwin = None
  CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_aarch64-apple-darwin = None
  CMAKE_GENERATOR_aarch64_apple_darwin = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-apple-darwin = None
  CMAKE_PREFIX_PATH_aarch64_apple_darwin = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-apple-darwin = None
  CMAKE_aarch64_apple_darwin = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "/Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake" "-Dprotobuf_BUILD_TESTS=OFF" "-DCMAKE_INSTALL_PREFIX=/Users/evenyag/codes/greptime/greptimedb/target/debug/build/prost-build-0ea56f31ebeedff1/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"

  --- stderr
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

  build script failed, must exit now', /Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

We may need to document it in README.md.

Serialize of Value::List is unimplemented

See value.rs

impl Serialize for Value {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer,
    {
        match self {
            Value::Null => serde_json::Value::Null.serialize(serializer),
            Value::Boolean(v) => v.serialize(serializer),
            Value::UInt8(v) => v.serialize(serializer),
            Value::UInt16(v) => v.serialize(serializer),
            Value::UInt32(v) => v.serialize(serializer),
            Value::UInt64(v) => v.serialize(serializer),
            Value::Int8(v) => v.serialize(serializer),
            Value::Int16(v) => v.serialize(serializer),
            Value::Int32(v) => v.serialize(serializer),
            Value::Int64(v) => v.serialize(serializer),
            Value::Float32(v) => v.serialize(serializer),
            Value::Float64(v) => v.serialize(serializer),
            Value::String(bytes) => bytes.serialize(serializer),
            Value::Binary(bytes) => bytes.serialize(serializer),
            Value::Date(v) => v.serialize(serializer),
            Value::DateTime(v) => v.serialize(serializer),
            Value::List(_) => unimplemented!(),
        }
    }
}

Value::List is not serialized. Also consider use derive(Serialize) for Value, if we find out a way to serialize null like json.

The serde_json use serialize_unit() to serialize null.

`PrimitiveVector` should as a logical data type

PrimitiveVector contains a primitive array, but the logical data type of vector may differ from it's internal array, for example, DateVector is represented by a Int32Vector, but the logical type is Date.

In fact, arrow's PrimitveArray::new accepts a parameter to specify it's logical data type, so PrimitiveVector should also have a logical data type.

Implement window functions

A lot of useful window functions are not implemented now.

Check how DataFusion supports defining these "User Defined Window Function" and implement them.

Impl alter table

At least 3 alter table stmt are required:
alter table add column
alter table add primary key
alter table drop primary key

Cannot plan SQL: SELECT @@version_comment LIMIT 1

Now the mysql connection will cause the following error, the sql connection try to execute SELECT @@version_comment LIMIT 1 but this query has not yet been supported now. Now this error won't abort the connection so the connection is still usable.

2022-08-23T09:49:35.096435Z ERROR datanode::instance: Instance failed to execute sql err.msg=Fail to execute sql, source: Cannot plan SQL: SELECT @@version_comment LIMIT 1, source: Execution error: variable ["@@version_comment"] has no type information err.code=PlanQuery err.source=Cannot plan SQL: SELECT @@version_comment LIMIT 1, source: Execution error: variable ["@@version_comment"] has no type information err.source.sources=[Execution error: variable ["@@version_comment"] has no type information] err.backtrace= 0 backtrace::backtrace::libunwind::trace::h8f05b594c8537893
   /Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/libunwind.rs:93
   backtrace::backtrace::trace_unsynchronized::he48f959c82ce5113
   /Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/mod.rs:66
 1 backtrace::backtrace::trace::hb86224d3b078e8da
   /Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/mod.rs:53
 2 backtrace::capture::Backtrace::create::h9789d97004306f06
   /Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/capture.rs:176
 3 backtrace::capture::Backtrace::new::h5de235bdfbf43121
   /Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/capture.rs:140
 4 <snafu::backtrace_shim::Backtrace as snafu::GenerateImplicitData>::generate::h9eb78aa53323f2ad
   /Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/snafu-0.7.1/src/backtrace_shim.rs:15
   <query::datafusion::error::PlanSqlSnafu<__T0> as snafu::IntoError<query::datafusion::error::InnerError>>::into_error::h94ab47a4a51200c2
   /Users/evenyag/codes/greptime/greptimedb/src/query/src/datafusion/error.rs:9
 5 <core::result::Result<T,E> as snafu::ResultExt<T,E>>::context::h3f710ecdc54a4991
   /Users/evenyag/.cargo/registry/src/github.com-1ecc6299db9ec823/snafu-0.7.1/src/lib.rs:674
 6 query::datafusion::planner::DfPlanner<S>::query_to_plan::h455c504dcd705179
   /Users/evenyag/codes/greptime/greptimedb/src/query/src/datafusion/planner.rs:32
 7 <query::datafusion::planner::DfPlanner<S> as query::planner::Planner>::statement_to_plan::h04d14eeddd53f446
   /Users/evenyag/codes/greptime/greptimedb/src/query/src/datafusion/planner.rs:51
 8 <query::datafusion::DatafusionQueryEngine as query::query_engine::QueryEngine>::statement_to_plan::h04a089485e34ef0c
   /Users/evenyag/codes/greptime/greptimedb/src/query/src/datafusion.rs:67
 9 datanode::instance::Instance::execute_sql::{{closure}}::h40c23984f96e5bf9
   /Users/evenyag/codes/greptime/greptimedb/src/datanode/src/instance.rs:103
10 <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h56d3993e941cbe98
   /rustc/76d770ac21d9521db6a92a48c7b3d5b2cc535941/library/core/src/future/mod.rs:91
11 <datanode::instance::Instance as servers::query_handler::SqlQueryHandler>::do_query::{{closure}}::h238d8856c07a6278
   /Users/evenyag/codes/greptime/greptimedb/src/datanode/src/instance.rs:231

Query and insert error for using frontend

Minimal reproduction

Start datanode and frontend:

$ cargo run -- datanode start

# other terminal screen
$ cargo run -- frontend start

# other terminal screen
$  mysql -h 127.0.0.1 -P 4002
> CREATE TABLE monitor (
  host STRING,
  ts BIGINT,
  cpu DOUBLE DEFAULT 0,
  memory DOUBLE,
  TIME INDEX (ts),
  PRIMARY KEY(ts,host)) ENGINE=mito WITH(regions=1);

Query error:

mysql> select * from monitor;
ERROR 1815 (HY000): Failed to execute query: select * from monitor, source: Failed to create RecordBatches, source: Fail to create datafusion record batch, source: Invalid argument error: at least one column must be defined to create a record batch

Insert error:

mysql> INSERT INTO monitor(host, cpu, memory, ts) VALUES ('host1', 66.6, 1024, 1660897955);
ERROR 1815 (HY000): Failed to execute query: INSERT INTO monitor(host, cpu, memory, ts) VALUES ('host1', 66.6, 1024, 1660897955), source: Tonic internal error, source: status: Unknown, message: "transport error", details: [], metadata: MetadataMap { headers: {} }

With datanode backtrace:

2022-09-13T11:29:16.754759Z ERROR common_telemetry::panic_hook: panicked at 'called `Option::unwrap()` on a `None` value', src/storage/src/write_batch.rs:205:87 backtrace=   0: backtrace::backtrace::libunwind::trace
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/libunwind.rs:93:5
      backtrace::backtrace::trace_unsynchronized
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/mod.rs:53:14
   2: backtrace::capture::Backtrace::create
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/capture.rs:176:9
   3: backtrace::capture::Backtrace::new
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/capture.rs:140:22
   4: common_telemetry::panic_hook::set_panic_hook::{{closure}}
             at src/common/telemetry/src/panic_hook.rs:16:25
   5: std::panicking::rust_panic_with_hook
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:702:17
   6: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:586:13
   7: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/sys_common/backtrace.rs:138:18
   8: rust_begin_unwind
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:584:5
   9: core::panicking::panic_fmt
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/panicking.rs:142:14
  10: core::panicking::panic
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/panicking.rs:48:5
  11: core::option::Option<T>::unwrap
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/option.rs:775:21
  12: <storage::write_batch::WriteBatch as store_api::storage::requests::WriteRequest>::time_ranges
             at src/storage/src/write_batch.rs:205:37
  13: storage::region::writer::WriterInner::prepare_memtables
             at src/storage/src/region/writer.rs:305:27
  14: storage::region::writer::WriterInner::preprocess_write::{{closure}}
             at src/storage/src/region/writer.rs:294:9
  15: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  16: storage::region::writer::WriterInner::write::{{closure}}
             at src/storage/src/region/writer.rs:166:71
  17: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  18: storage::region::writer::RegionWriter::write::{{closure}}
             at src/storage/src/region/writer.rs:56:66
  19: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  20: storage::region::RegionInner<S>::write::{{closure}}
             at src/storage/src/region.rs:366:52
  21: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  22: <storage::region::RegionImpl<S> as store_api::storage::region::Region>::write::{{closure}}
             at src/storage/src/region.rs:68:39
  23: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  24: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/future.rs:124:9
  25: <table_engine::table::MitoTable<R> as table::table::Table>::insert::{{closure}}
             at src/table-engine/src/table.rs:107:60
  26: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  27: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/future.rs:124:9
  28: datanode::sql::insert::<impl datanode::sql::SqlHandler>::insert::{{closure}}
             at src/datanode/src/sql/insert.rs:27:25
  29: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  30: datanode::sql::SqlHandler::execute::{{closure}}
             at src/datanode/src/sql.rs:39:56
  31: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  32: datanode::instance::Instance::execute_sql::{{closure}}
             at src/datanode/src/instance.rs:137:50
  33: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  34: <datanode::instance::Instance as servers::query_handler::GrpcQueryHandler>::do_query::{{closure}}
             at src/datanode/src/instance.rs:334:60
  35: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  36: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/future.rs:124:9
  37: servers::grpc::handler::BatchHandler::batch::{{closure}}
             at src/servers/src/grpc/handler.rs:35:72
  38: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  39: <servers::grpc::GrpcService as api::v1::greptime_server::Greptime>::batch::{{closure}}
             at src/servers/src/grpc.rs:50:42
  40: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  41: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/future.rs:124:9
  42: <<api::v1::greptime_server::GreptimeServer<T> as tower_service::Service<http::request::Request<B>>>::call::BatchSvc<T> as tonic::server::service::UnaryService<api::v1::BatchRequest>>::call::{{closure}}
             at target/debug/build/api-09ac1f8315803f15/out/greptime.v1.rs:553:75
  43: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  44: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/future.rs:124:9
  45: tonic::server::grpc::Grpc<T>::unary::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tonic-0.8.0/src/server/grpc.rs:166:27
  46: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  47: <api::v1::greptime_server::GreptimeServer<T> as tower_service::Service<http::request::Request<B>>>::call::{{closure}}
             at target/debug/build/api-09ac1f8315803f15/out/greptime.v1.rs:569:58
  48: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/mod.rs:91:19
  49: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/future.rs:124:9
  50: <F as futures_core::future::TryFuture>::try_poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-0.3.21/src/future.rs:82:9
  51: <futures_util::future::try_future::into_future::IntoFuture<Fut> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/try_future/into_future.rs:34:9
  52: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/future/future/map.rs:55:37
  53: <thread 'futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/lib.rs:91:13
  54: <futures_util::future::try_future::MapOk<Fut,F> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.21/src/lib.rs:91:13
  55: <tower::util::map_response::MapResponseFuture<F,N> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tower-0.4.12/src/macros.rs:38:17
  56: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/future.rs:124:9
  57: <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tower-0.4.12/src/util/oneshot.rs:97:38
  58: <axum::routing::route::RouteFuture<B,E> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-0.5.4/src/routing/route.rs:150:61
  59: <tonic::transport::service::router::RoutesFuture as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tonic-0.8.0/src/transport/service/router.rs:90:36
  60: <tonic::transport::service::grpc_timeout::ResponseFuture<F> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tonic-0.8.0/src/transport/service/grpc_timeout.rs:88:38
  61: <tower::util::either::Either<A,B> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tower-0.4.12/src/util/either.rs:71:57
  62: <tonic::transport::server::recover_error::ResponseFuture<F> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tonic-0.8.0/src/transport/server/recover_error.rs:63:20
  63: <tonic::transport::server::SvcFuture<F> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tonic-0.8.0/src/transport/server/mod.rs:749:50
  64: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/future/future.rs:124:9
  65: hyper::proto::h2::server::H2Stream<F,B>::poll2
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.18/src/proto/h2/server.rs:448:37
  66: <hyper::proto::h2::server::H2Stream<F,B> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.18/src/proto/h2/server.rs:537:9
  67: tokio::runtime::task::core::CoreStage<T>::poll::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/core.rs:165:17
  68: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/loom/std/unsafe_cell.rs:14:9
  69: tokio::runtime::task::core::CoreStage<T>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/core.rs:155:13
  70: tokio::runtime::task::harness::poll_future::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/harness.rs:480:19
  71: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/panic/unwind_safe.rs:271:9
  72: std::panicking::try::do_call
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:492:40
  73: ___rust_try
  74: std::panicking::try
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:456:19
  75: std::panic::catch_unwind
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panic.rs:137:14
  76: tokio::runtime::task::harness::poll_future
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/harness.rs:468:18
  77: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/harness.rs:104:27
  78: tokio::runtime::task::harness::Harness<T,S>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/harness.rs:57:15
  79: tokio::runtime::task::raw::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/raw.rs:144:5
  80: tokio::runtime::task::raw::RawTask::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/raw.rs:84:18
  81: tokio::runtime::task::LocalNotified<S>::run
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/mod.rs:381:9
  82: tokio::runtime::thread_pool::worker::Context::run_task::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/thread_pool/worker.rs:458:21
  83: tokio::coop::with_budget::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/coop.rs:102:9
  84: std::thread::local::LocalKey<T>::try_with
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/thread/local.rs:445:16
  85: std::thread::local::LocalKey<T>::with
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/thread/local.rs:421:9
  86: tokio::coop::with_budget
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/coop.rs:95:5
      tokio::coop::budget
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/coop.rs:72:5
      tokio::runtime::thread_pool::worker::Context::run_task
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/thread_pool/worker.rs:434:9
  87: tokio::runtime::thread_pool::worker::Context::run
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/thread_pool/worker.rs:401:24
  88: tokio::runtime::thread_pool::worker::run::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/thread_pool/worker.rs:386:17
  89: tokio::macros::scoped_tls::ScopedKey<T>::set
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/macros/scoped_tls.rs:61:9
  90: tokio::runtime::thread_pool::worker::run
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/thread_pool/worker.rs:383:5
  91: tokio::runtime::thread_pool::worker::Launch::launch::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/thread_pool/worker.rs:362:45
  92: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/blocking/task.rs:42:21
  93: tokio::runtime::task::core::CoreStage<T>::poll::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/core.rs:165:17
  94: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/loom/std/unsafe_cell.rs:14:9
  95: tokio::runtime::task::core::CoreStage<T>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/core.rs:155:13
  96: tokio::runtime::task::harness::poll_future::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/harness.rs:480:19
  97: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/panic/unwind_safe.rs:271:9
  98: std::panicking::try::do_call
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:492:40
  99: ___rust_try
 100: std::panicking::try
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:456:19
 101: std::panic::catch_unwind
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panic.rs:137:14
 102: tokio::runtime::task::harness::poll_future
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/harness.rs:468:18
 103: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /Users/zyy17/.cargo/registry/src/gitokio-runtime-workerthub.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/harness.rs:104:27
 104: tokio::runtime::task::harness::Harness<T,S>::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/harness.rs:57:15
 105: tokio::runtime::task::raw::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/raw.rs:144:5
 106: tokio::runtime::task::raw::RawTask::poll
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/raw.rs:84:18
 107: tokio::runtime::task::UnownedTask<S>::run
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/task/mod.rs:418:9
 108: tokio::runtime::blocking::pool::Task::run
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/blocking/pool.rs:91:9
 109: tokio::runtime::blocking::pool::Inner::run
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/blocking/pool.rs:325:17
 110: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
             at /Users/zyy17/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/blocking/pool.rs:300:13
 111: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/sys_common/backtrace.rs:122:18
 112: std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/thread/mod.rs:505:17
 113: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/panic/unwind_safe.rs:271:9
 114: std::panicking::try::do_call
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:492:40
 115: ___rust_try
 116: std::panicking::try
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panicking.rs:456:19
 117: std::panic::catch_unwind
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/panic.rs:137:14
 118: std::thread::Builder::spawn_unchecked_::{{closure}}
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/thread/mod.rs:504:30
 119: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/core/src/ops/function.rs:248:5
 120: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/alloc/src/boxed.rs:1934:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/alloc/src/boxed.rs:1934:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/87588a2afd9ca903366f0deaf84d805f34469384/library/std/src/sys/unix/thread.rs:108:17
 121: __pthread_deallocate
 panic.file="src/storage/src/write_batch.rs" panic.line=205 panic.column=87
' panicked at 'called `Option::unwrap()` on a `None` value', src/storage/src/write_batch.rs:205:87
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.