diff --git a/.github/actions/build-dev-builder-images/action.yml b/.github/actions/build-dev-builder-images/action.yml
index 6bb14e14f4..9c30caad35 100644
--- a/.github/actions/build-dev-builder-images/action.yml
+++ b/.github/actions/build-dev-builder-images/action.yml
@@ -50,7 +50,7 @@ runs:
BUILDX_MULTI_PLATFORM_BUILD=all \
IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \
IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \
- IMAGE_TAG=${{ inputs.version }}
+ DEV_BUILDER_IMAGE_TAG=${{ inputs.version }}
- name: Build and push dev-builder-centos image
shell: bash
@@ -61,7 +61,7 @@ runs:
BUILDX_MULTI_PLATFORM_BUILD=amd64 \
IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \
IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \
- IMAGE_TAG=${{ inputs.version }}
+ DEV_BUILDER_IMAGE_TAG=${{ inputs.version }}
- name: Build and push dev-builder-android image # Only build image for amd64 platform.
shell: bash
@@ -71,6 +71,6 @@ runs:
BASE_IMAGE=android \
IMAGE_REGISTRY=${{ inputs.dockerhub-image-registry }} \
IMAGE_NAMESPACE=${{ inputs.dockerhub-image-namespace }} \
- IMAGE_TAG=${{ inputs.version }} && \
+ DEV_BUILDER_IMAGE_TAG=${{ inputs.version }} && \
docker push ${{ inputs.dockerhub-image-registry }}/${{ inputs.dockerhub-image-namespace }}/dev-builder-android:${{ inputs.version }}
diff --git a/.github/actions/build-windows-artifacts/action.yml b/.github/actions/build-windows-artifacts/action.yml
index 0cb8884cbd..0d92e1512e 100644
--- a/.github/actions/build-windows-artifacts/action.yml
+++ b/.github/actions/build-windows-artifacts/action.yml
@@ -40,7 +40,7 @@ runs:
- name: Install PyArrow Package
shell: pwsh
- run: pip install pyarrow
+ run: pip install pyarrow numpy
- name: Install WSL distribution
uses: Vampire/setup-wsl@v2
diff --git a/.github/actions/setup-etcd-cluster/action.yml b/.github/actions/setup-etcd-cluster/action.yml
index 7d0d8d01ab..e6abb96bc2 100644
--- a/.github/actions/setup-etcd-cluster/action.yml
+++ b/.github/actions/setup-etcd-cluster/action.yml
@@ -18,7 +18,7 @@ runs:
--set replicaCount=${{ inputs.etcd-replicas }} \
--set resources.requests.cpu=50m \
--set resources.requests.memory=128Mi \
- --set resources.limits.cpu=1000m \
+ --set resources.limits.cpu=1500m \
--set resources.limits.memory=2Gi \
--set auth.rbac.create=false \
--set auth.rbac.token.enabled=false \
diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml
index 5100b89754..80a4f042c0 100644
--- a/.github/workflows/develop.yml
+++ b/.github/workflows/develop.yml
@@ -269,6 +269,13 @@ jobs:
- name: Install cargo-gc-bin
shell: bash
run: cargo install cargo-gc-bin
+ - name: Check aws-lc-sys will not build
+ shell: bash
+ run: |
+ if cargo tree -i aws-lc-sys -e features | grep -q aws-lc-sys; then
+ echo "Found aws-lc-sys, which has compilation problems on older gcc versions. Please replace it with ring until its building experience improves."
+ exit 1
+ fi
- name: Build greptime bianry
shell: bash
# `cargo gc` will invoke `cargo build` with specified args
@@ -429,12 +436,25 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
- target: ["fuzz_migrate_mito_regions", "fuzz_failover_mito_regions", "fuzz_failover_metric_regions"]
+ target: ["fuzz_migrate_mito_regions", "fuzz_migrate_metric_regions", "fuzz_failover_mito_regions", "fuzz_failover_metric_regions"]
mode:
- name: "Remote WAL"
minio: true
kafka: true
values: "with-remote-wal.yaml"
+ include:
+ - target: "fuzz_migrate_mito_regions"
+ mode:
+ name: "Local WAL"
+ minio: true
+ kafka: false
+ values: "with-minio.yaml"
+ - target: "fuzz_migrate_metric_regions"
+ mode:
+ name: "Local WAL"
+ minio: true
+ kafka: false
+ values: "with-minio.yaml"
steps:
- name: Remove unused software
run: |
@@ -523,7 +543,7 @@ jobs:
with:
image-registry: localhost:5001
values-filename: ${{ matrix.mode.values }}
- enable-region-failover: true
+ enable-region-failover: ${{ matrix.mode.kafka }}
- name: Port forward (mysql)
run: |
kubectl port-forward service/my-greptimedb-frontend 4002:4002 -n my-greptimedb&
@@ -674,7 +694,7 @@ jobs:
with:
python-version: '3.10'
- name: Install PyArrow Package
- run: pip install pyarrow
+ run: pip install pyarrow numpy
- name: Setup etcd server
working-directory: tests-integration/fixtures/etcd
run: docker compose -f docker-compose-standalone.yml up -d --wait
diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml
index a2379e0e39..5b47b49ff0 100644
--- a/.github/workflows/nightly-ci.yml
+++ b/.github/workflows/nightly-ci.yml
@@ -92,7 +92,7 @@ jobs:
with:
python-version: "3.10"
- name: Install PyArrow Package
- run: pip install pyarrow
+ run: pip install pyarrow numpy
- name: Install WSL distribution
uses: Vampire/setup-wsl@v2
with:
diff --git a/Cargo.lock b/Cargo.lock
index c5b8fc016a..53ab681cd6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
+version = 4
[[package]]
name = "Inflector"
@@ -10,18 +10,18 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
[[package]]
name = "addr2line"
-version = "0.22.0"
+version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678"
+checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375"
dependencies = [
"gimli",
]
[[package]]
-name = "adler"
-version = "1.0.2"
+name = "adler2"
+version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
[[package]]
name = "adler32"
@@ -147,9 +147,9 @@ dependencies = [
[[package]]
name = "anstream"
-version = "0.6.14"
+version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
+checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526"
dependencies = [
"anstyle",
"anstyle-parse",
@@ -162,33 +162,33 @@ dependencies = [
[[package]]
name = "anstyle"
-version = "1.0.7"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
+checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
[[package]]
name = "anstyle-parse"
-version = "0.2.4"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
+checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
-version = "1.1.0"
+version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391"
+checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a"
dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "anstyle-wincon"
-version = "3.0.3"
+version = "3.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
+checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8"
dependencies = [
"anstyle",
"windows-sys 0.52.0",
@@ -196,15 +196,9 @@ dependencies = [
[[package]]
name = "anyhow"
-version = "1.0.86"
+version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
-
-[[package]]
-name = "anymap"
-version = "1.0.0-beta.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f1f8f5a6f3d50d89e3797d7593a50f96bb2aaa20ca0cc7be1fb673232c91d72"
+checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6"
[[package]]
name = "anymap2"
@@ -214,7 +208,7 @@ checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c"
[[package]]
name = "api"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"common-base",
"common-decimal",
@@ -226,10 +220,19 @@ dependencies = [
"paste",
"prost 0.12.6",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tonic-build",
]
+[[package]]
+name = "approx"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "approx"
version = "0.5.1"
@@ -282,15 +285,15 @@ checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc"
[[package]]
name = "arrayref"
-version = "0.3.7"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
+checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
[[package]]
name = "arrayvec"
-version = "0.7.4"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
+checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "arrow"
@@ -443,6 +446,7 @@ dependencies = [
"arrow-schema",
"flatbuffers",
"lz4_flex 0.11.3",
+ "zstd 0.13.2",
]
[[package]]
@@ -458,7 +462,7 @@ dependencies = [
"arrow-schema",
"chrono",
"half 2.4.1",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"lexical-core",
"num",
"serde",
@@ -501,7 +505,7 @@ version = "51.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02d9483aaabe910c4781153ae1b6ae0393f72d9ef757d38d09d450070cf2e528"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"serde",
]
@@ -533,7 +537,7 @@ dependencies = [
"memchr",
"num",
"regex",
- "regex-syntax 0.8.4",
+ "regex-syntax 0.8.5",
]
[[package]]
@@ -606,11 +610,11 @@ dependencies = [
[[package]]
name = "async-compression"
-version = "0.4.11"
+version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5"
+checksum = "7e614738943d3f68c628ae3dbce7c3daffb196665f82f8c8ea6b65de73c79429"
dependencies = [
- "brotli 6.0.0",
+ "brotli 7.0.0",
"bzip2",
"flate2",
"futures-core",
@@ -619,8 +623,8 @@ dependencies = [
"pin-project-lite",
"tokio",
"xz2",
- "zstd 0.13.1",
- "zstd-safe 7.1.0",
+ "zstd 0.13.2",
+ "zstd-safe 7.2.1",
]
[[package]]
@@ -653,14 +657,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "async-stream"
-version = "0.3.5"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51"
+checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476"
dependencies = [
"async-stream-impl",
"futures-core",
@@ -669,13 +673,13 @@ dependencies = [
[[package]]
name = "async-stream-impl"
-version = "0.3.5"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
+checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -686,13 +690,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
[[package]]
name = "async-trait"
-version = "0.1.80"
+version = "0.1.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
+checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -739,9 +743,12 @@ dependencies = [
[[package]]
name = "atomic"
-version = "0.5.3"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba"
+checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994"
+dependencies = [
+ "bytemuck",
+]
[[package]]
name = "atomic-waker"
@@ -762,7 +769,7 @@ dependencies = [
[[package]]
name = "auth"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
@@ -774,7 +781,7 @@ dependencies = [
"digest",
"notify",
"sha1",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"tokio",
]
@@ -787,7 +794,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -798,9 +805,9 @@ checksum = "7460f7dd8e100147b82a63afca1a20eb6c231ee36b90ba7272e14951cb58af59"
[[package]]
name = "autocfg"
-version = "1.3.0"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
+checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "autotools"
@@ -811,6 +818,21 @@ dependencies = [
"cc",
]
+[[package]]
+name = "aws-lc-sys"
+version = "0.21.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b3ddc4a5b231dd6958b140ff3151b6412b3f4321fab354f399eec8f14b06df62"
+dependencies = [
+ "bindgen 0.69.4",
+ "cc",
+ "cmake",
+ "dunce",
+ "fs_extra",
+ "libc",
+ "paste",
+]
+
[[package]]
name = "axum"
version = "0.6.20"
@@ -825,7 +847,7 @@ dependencies = [
"headers 0.3.9",
"http 0.2.12",
"http-body 0.4.6",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"itoa",
"matchit",
"memchr",
@@ -838,7 +860,7 @@ dependencies = [
"serde_json",
"serde_path_to_error",
"serde_urlencoded",
- "sync_wrapper",
+ "sync_wrapper 0.1.2",
"tokio",
"tower",
"tower-layer",
@@ -871,7 +893,7 @@ dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -899,26 +921,28 @@ dependencies = [
[[package]]
name = "backon"
-version = "1.0.2"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2caf634d05fe0642d0fb1ab43497fa627088ecd93f84b2d0f2a5d7b91f7730db"
+checksum = "e4fa97bb310c33c811334143cf64c5bb2b7b3c06e453db6b095d7061eff8f113"
dependencies = [
"fastrand",
+ "gloo-timers",
+ "tokio",
]
[[package]]
name = "backtrace"
-version = "0.3.73"
+version = "0.3.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a"
+checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a"
dependencies = [
"addr2line",
- "cc",
"cfg-if",
"libc",
"miniz_oxide",
"object",
"rustc-demangle",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -955,6 +979,18 @@ dependencies = [
"smallvec",
]
+[[package]]
+name = "bigdecimal"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa"
+dependencies = [
+ "num-bigint",
+ "num-integer",
+ "num-traits",
+ "serde",
+]
+
[[package]]
name = "bigdecimal"
version = "0.4.5"
@@ -979,22 +1015,62 @@ dependencies = [
[[package]]
name = "bindgen"
-version = "0.69.4"
+version = "0.59.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
+checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 1.3.2",
"cexpr",
"clang-sys",
- "itertools 0.12.1",
"lazy_static",
"lazycell",
+ "peeking_take_while",
"proc-macro2",
"quote",
"regex",
"rustc-hash 1.1.0",
"shlex",
- "syn 2.0.66",
+]
+
+[[package]]
+name = "bindgen"
+version = "0.69.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
+dependencies = [
+ "bitflags 2.6.0",
+ "cexpr",
+ "clang-sys",
+ "itertools 0.12.1",
+ "lazy_static",
+ "lazycell",
+ "log",
+ "prettyplease",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "rustc-hash 1.1.0",
+ "shlex",
+ "syn 2.0.79",
+ "which",
+]
+
+[[package]]
+name = "bindgen"
+version = "0.70.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f"
+dependencies = [
+ "bitflags 2.6.0",
+ "cexpr",
+ "clang-sys",
+ "itertools 0.13.0",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "rustc-hash 1.1.0",
+ "shlex",
+ "syn 2.0.79",
]
[[package]]
@@ -1020,9 +1096,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
-version = "2.5.0"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
+checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "bitpacking"
@@ -1056,9 +1132,9 @@ dependencies = [
[[package]]
name = "blake3"
-version = "1.5.1"
+version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52"
+checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7"
dependencies = [
"arrayref",
"arrayvec",
@@ -1115,10 +1191,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b"
dependencies = [
"once_cell",
- "proc-macro-crate 3.1.0",
+ "proc-macro-crate 3.2.0",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
"syn_derive",
]
@@ -1135,9 +1211,9 @@ dependencies = [
[[package]]
name = "brotli"
-version = "6.0.0"
+version = "7.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b"
+checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd"
dependencies = [
"alloc-no-stdlib",
"alloc-stdlib",
@@ -1175,6 +1251,17 @@ dependencies = [
"regex-automata 0.1.10",
]
+[[package]]
+name = "bstr"
+version = "1.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c"
+dependencies = [
+ "memchr",
+ "regex-automata 0.4.8",
+ "serde",
+]
+
[[package]]
name = "btoi"
version = "0.4.3"
@@ -1184,6 +1271,12 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "bufstream"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8"
+
[[package]]
name = "build-data"
version = "0.2.1"
@@ -1224,9 +1317,9 @@ dependencies = [
[[package]]
name = "bytemuck"
-version = "1.16.0"
+version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5"
+checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae"
[[package]]
name = "byteorder"
@@ -1236,9 +1329,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "bytes"
-version = "1.6.0"
+version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
+checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3"
dependencies = [
"serde",
]
@@ -1286,15 +1379,15 @@ dependencies = [
[[package]]
name = "cache"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"catalog",
"common-error",
"common-macro",
"common-meta",
"moka",
- "snafu 0.8.4",
- "substrait 0.9.3",
+ "snafu 0.8.5",
+ "substrait 0.9.5",
]
[[package]]
@@ -1321,7 +1414,7 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "catalog"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arrow",
@@ -1337,8 +1430,10 @@ dependencies = [
"common-error",
"common-macro",
"common-meta",
+ "common-procedure",
"common-query",
"common-recordbatch",
+ "common-runtime",
"common-telemetry",
"common-test-util",
"common-time",
@@ -1361,11 +1456,12 @@ dependencies = [
"rustc-hash 2.0.0",
"serde_json",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"store-api",
"table",
"tokio",
+ "tokio-stream",
]
[[package]]
@@ -1379,13 +1475,13 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.0.99"
+version = "1.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695"
+checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938"
dependencies = [
"jobserver",
"libc",
- "once_cell",
+ "shlex",
]
[[package]]
@@ -1448,7 +1544,7 @@ version = "0.13.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6026d8cd82ada8bbcfe337805dd1eb6afdc9e80fa4d57e977b3a36315e0c5525"
dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"lazy_static",
"num-traits",
"regex",
@@ -1456,6 +1552,16 @@ dependencies = [
"vob",
]
+[[package]]
+name = "cgmath"
+version = "0.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317"
+dependencies = [
+ "approx 0.4.0",
+ "num-traits",
+]
+
[[package]]
name = "chrono"
version = "0.4.38"
@@ -1468,7 +1574,7 @@ dependencies = [
"num-traits",
"serde",
"wasm-bindgen",
- "windows-targets 0.52.5",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -1566,7 +1672,7 @@ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
dependencies = [
"glob",
"libc",
- "libloading 0.8.3",
+ "libloading 0.8.5",
]
[[package]]
@@ -1598,9 +1704,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.5.7"
+version = "4.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f"
+checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615"
dependencies = [
"clap_builder",
"clap_derive",
@@ -1608,26 +1714,26 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.7"
+version = "4.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f"
+checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b"
dependencies = [
"anstream",
"anstyle",
- "clap_lex 0.7.1",
+ "clap_lex 0.7.2",
"strsim 0.11.1",
]
[[package]]
name = "clap_derive"
-version = "4.5.5"
+version = "4.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6"
+checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab"
dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -1641,13 +1747,13 @@ dependencies = [
[[package]]
name = "clap_lex"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
+checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
[[package]]
name = "client"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arc-swap",
@@ -1675,14 +1781,13 @@ dependencies = [
"query",
"rand",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"substrait 0.37.3",
- "substrait 0.9.3",
+ "substrait 0.9.5",
"tokio",
"tokio-stream",
"tonic 0.11.0",
"tracing",
- "tracing-subscriber",
]
[[package]]
@@ -1697,17 +1802,28 @@ dependencies = [
]
[[package]]
-name = "cmake"
-version = "0.1.50"
+name = "clocksource"
+version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130"
+checksum = "129026dd5a8a9592d96916258f3a5379589e513ea5e86aeb0bd2530286e44e9e"
+dependencies = [
+ "libc",
+ "time",
+ "winapi",
+]
+
+[[package]]
+name = "cmake"
+version = "0.1.51"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a"
dependencies = [
"cc",
]
[[package]]
name = "cmd"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-trait",
"auth",
@@ -1715,7 +1831,7 @@ dependencies = [
"cache",
"catalog",
"chrono",
- "clap 4.5.7",
+ "clap 4.5.19",
"client",
"common-base",
"common-catalog",
@@ -1761,24 +1877,25 @@ dependencies = [
"serde_json",
"servers",
"session",
- "snafu 0.8.4",
+ "similar-asserts",
+ "snafu 0.8.5",
"store-api",
- "substrait 0.9.3",
+ "substrait 0.9.5",
"table",
"temp-env",
"tempfile",
"tikv-jemallocator",
"tokio",
- "toml 0.8.14",
+ "toml 0.8.19",
"tonic 0.11.0",
"tracing-appender",
]
[[package]]
name = "colorchoice"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
+checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
[[package]]
name = "combine"
@@ -1796,7 +1913,7 @@ version = "7.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7"
dependencies = [
- "strum 0.26.2",
+ "strum 0.26.3",
"strum_macros 0.26.4",
"unicode-width",
]
@@ -1809,9 +1926,9 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
[[package]]
name = "common-base"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
- "anymap",
+ "anymap2",
"async-trait",
"bitvec",
"bytes",
@@ -1820,25 +1937,25 @@ dependencies = [
"futures",
"paste",
"serde",
- "snafu 0.8.4",
- "toml 0.8.14",
+ "snafu 0.8.5",
+ "toml 0.8.19",
"zeroize",
]
[[package]]
name = "common-catalog"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"chrono",
"common-error",
"common-macro",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tokio",
]
[[package]]
name = "common-config"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"common-base",
"common-error",
@@ -1852,16 +1969,16 @@ dependencies = [
"num_cpus",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sysinfo",
"temp-env",
"tempfile",
- "toml 0.8.14",
+ "toml 0.8.19",
]
[[package]]
name = "common-datasource"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"arrow",
"arrow-schema",
@@ -1888,7 +2005,7 @@ dependencies = [
"rand",
"regex",
"serde",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"strum 0.25.0",
"tokio",
"tokio-util",
@@ -1898,29 +2015,29 @@ dependencies = [
[[package]]
name = "common-decimal"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
- "bigdecimal",
+ "bigdecimal 0.4.5",
"common-error",
"common-macro",
"rust_decimal",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
]
[[package]]
name = "common-error"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
- "snafu 0.8.4",
+ "snafu 0.8.5",
"strum 0.25.0",
"tonic 0.11.0",
]
[[package]]
name = "common-frontend"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
@@ -1929,13 +2046,13 @@ dependencies = [
"common-macro",
"common-query",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
]
[[package]]
name = "common-function"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arc-swap",
@@ -1952,6 +2069,7 @@ dependencies = [
"common-version",
"datafusion",
"datatypes",
+ "derive_more",
"geohash",
"h3o",
"jsonb",
@@ -1960,10 +2078,11 @@ dependencies = [
"once_cell",
"paste",
"ron",
+ "s2",
"serde",
"serde_json",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"statrs",
"store-api",
@@ -1973,14 +2092,14 @@ dependencies = [
[[package]]
name = "common-greptimedb-telemetry"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-trait",
"common-runtime",
"common-telemetry",
"common-test-util",
"common-version",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"reqwest",
"serde",
"tempfile",
@@ -1990,7 +2109,7 @@ dependencies = [
[[package]]
name = "common-grpc"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arrow-flight",
@@ -2008,7 +2127,7 @@ dependencies = [
"lazy_static",
"prost 0.12.6",
"rand",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tokio",
"tonic 0.11.0",
"tower",
@@ -2016,7 +2135,7 @@ dependencies = [
[[package]]
name = "common-grpc-expr"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"common-base",
@@ -2028,31 +2147,32 @@ dependencies = [
"datatypes",
"paste",
"prost 0.12.6",
- "snafu 0.8.4",
+ "snafu 0.8.5",
+ "store-api",
"table",
]
[[package]]
name = "common-macro"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"arc-swap",
"common-query",
"datatypes",
"proc-macro2",
"quote",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"static_assertions",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "common-mem-prof"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"common-error",
"common-macro",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tempfile",
"tikv-jemalloc-ctl",
"tikv-jemalloc-sys",
@@ -2061,11 +2181,12 @@ dependencies = [
[[package]]
name = "common-meta"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"anymap2",
"api",
"async-recursion",
+ "async-stream",
"async-trait",
"base64 0.21.7",
"bytes",
@@ -2091,7 +2212,7 @@ dependencies = [
"futures-util",
"hex",
"humantime-serde",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"itertools 0.10.5",
"lazy_static",
"moka",
@@ -2104,7 +2225,7 @@ dependencies = [
"serde_json",
"serde_with",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
"strum 0.25.0",
"table",
@@ -2117,21 +2238,34 @@ dependencies = [
[[package]]
name = "common-plugins"
-version = "0.9.3"
+version = "0.9.5"
+
+[[package]]
+name = "common-pprof"
+version = "0.9.5"
+dependencies = [
+ "common-error",
+ "common-macro",
+ "pprof",
+ "prost 0.12.6",
+ "snafu 0.8.5",
+ "tokio",
+]
[[package]]
name = "common-procedure"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-stream",
"async-trait",
- "backon 1.0.2",
+ "backon 1.2.0",
"common-base",
"common-error",
"common-macro",
"common-runtime",
"common-telemetry",
"common-test-util",
+ "common-time",
"futures",
"futures-util",
"humantime-serde",
@@ -2140,14 +2274,14 @@ dependencies = [
"serde",
"serde_json",
"smallvec",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tokio",
"uuid",
]
[[package]]
name = "common-procedure-test"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-trait",
"common-procedure",
@@ -2155,7 +2289,7 @@ dependencies = [
[[package]]
name = "common-query"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
@@ -2171,7 +2305,7 @@ dependencies = [
"datatypes",
"futures-util",
"serde",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)",
"sqlparser_derive 0.1.1",
"statrs",
@@ -2181,7 +2315,7 @@ dependencies = [
[[package]]
name = "common-recordbatch"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"arc-swap",
"common-error",
@@ -2194,25 +2328,33 @@ dependencies = [
"pin-project",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tokio",
]
[[package]]
name = "common-runtime"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-trait",
+ "clap 4.5.19",
"common-error",
"common-macro",
"common-telemetry",
+ "futures",
"lazy_static",
"num_cpus",
"once_cell",
+ "parking_lot 0.12.3",
"paste",
+ "pin-project",
"prometheus",
+ "rand",
+ "ratelimit",
"serde",
- "snafu 0.8.4",
+ "serde_json",
+ "snafu 0.8.5",
+ "tempfile",
"tokio",
"tokio-metrics",
"tokio-metrics-collector",
@@ -2222,13 +2364,14 @@ dependencies = [
[[package]]
name = "common-telemetry"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"atty",
"backtrace",
"common-error",
"console-subscriber",
"greptime-proto",
+ "humantime-serde",
"lazy_static",
"once_cell",
"opentelemetry 0.21.0",
@@ -2249,7 +2392,7 @@ dependencies = [
[[package]]
name = "common-test-util"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"client",
"common-query",
@@ -2261,7 +2404,7 @@ dependencies = [
[[package]]
name = "common-time"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"arrow",
"chrono",
@@ -2272,12 +2415,12 @@ dependencies = [
"rand",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
]
[[package]]
name = "common-version"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"build-data",
"const_format",
@@ -2288,7 +2431,7 @@ dependencies = [
[[package]]
name = "common-wal"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"common-base",
"common-error",
@@ -2298,15 +2441,15 @@ dependencies = [
"humantime-serde",
"num_cpus",
"rskafka",
- "rustls 0.23.10",
- "rustls-native-certs",
- "rustls-pemfile 2.1.2",
+ "rustls 0.23.13",
+ "rustls-native-certs 0.7.3",
+ "rustls-pemfile 2.2.0",
"serde",
"serde_json",
"serde_with",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tokio",
- "toml 0.8.14",
+ "toml 0.8.19",
]
[[package]]
@@ -2426,18 +2569,18 @@ checksum = "373e9fafaa20882876db20562275ff58d50e0caa2590077fe7ce7bef90211d0d"
[[package]]
name = "const_format"
-version = "0.2.32"
+version = "0.2.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673"
+checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b"
dependencies = [
"const_format_proc_macros",
]
[[package]]
name = "const_format_proc_macros"
-version = "0.2.32"
+version = "0.2.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500"
+checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1"
dependencies = [
"proc-macro2",
"quote",
@@ -2446,9 +2589,9 @@ dependencies = [
[[package]]
name = "constant_time_eq"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2"
+checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6"
[[package]]
name = "core-foundation"
@@ -2462,9 +2605,9 @@ dependencies = [
[[package]]
name = "core-foundation-sys"
-version = "0.8.6"
+version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "core2"
@@ -2477,18 +2620,18 @@ dependencies = [
[[package]]
name = "cpp_demangle"
-version = "0.4.3"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119"
+checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d"
dependencies = [
"cfg-if",
]
[[package]]
name = "cpufeatures"
-version = "0.2.12"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
+checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0"
dependencies = [
"libc",
]
@@ -2563,7 +2706,7 @@ dependencies = [
"anes",
"cast",
"ciborium",
- "clap 4.5.7",
+ "clap 4.5.19",
"criterion-plot",
"is-terminal",
"itertools 0.10.5",
@@ -2715,12 +2858,12 @@ dependencies = [
[[package]]
name = "darling"
-version = "0.20.9"
+version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1"
+checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989"
dependencies = [
- "darling_core 0.20.9",
- "darling_macro 0.20.9",
+ "darling_core 0.20.10",
+ "darling_macro 0.20.10",
]
[[package]]
@@ -2739,16 +2882,16 @@ dependencies = [
[[package]]
name = "darling_core"
-version = "0.20.9"
+version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120"
+checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5"
dependencies = [
"fnv",
"ident_case",
"proc-macro2",
"quote",
"strsim 0.11.1",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -2764,13 +2907,13 @@ dependencies = [
[[package]]
name = "darling_macro"
-version = "0.20.9"
+version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178"
+checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [
- "darling_core 0.20.9",
+ "darling_core 0.20.10",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -2802,7 +2945,7 @@ dependencies = [
"arrow-array",
"arrow-ipc",
"arrow-schema",
- "async-compression 0.4.11",
+ "async-compression 0.4.13",
"async-trait",
"bytes",
"bzip2",
@@ -2825,7 +2968,7 @@ dependencies = [
"glob",
"half 2.4.1",
"hashbrown 0.14.5",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"itertools 0.12.1",
"log",
"num_cpus",
@@ -2841,7 +2984,7 @@ dependencies = [
"url",
"uuid",
"xz2",
- "zstd 0.13.1",
+ "zstd 0.13.2",
]
[[package]]
@@ -2906,7 +3049,7 @@ dependencies = [
"paste",
"serde_json",
"sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "strum 0.26.2",
+ "strum 0.26.3",
"strum_macros 0.26.4",
]
@@ -2984,10 +3127,10 @@ dependencies = [
"datafusion-expr",
"datafusion-physical-expr",
"hashbrown 0.14.5",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"itertools 0.12.1",
"log",
- "regex-syntax 0.8.4",
+ "regex-syntax 0.8.5",
]
[[package]]
@@ -3012,7 +3155,7 @@ dependencies = [
"half 2.4.1",
"hashbrown 0.14.5",
"hex",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"itertools 0.12.1",
"log",
"paste",
@@ -3054,7 +3197,7 @@ dependencies = [
"futures",
"half 2.4.1",
"hashbrown 0.14.5",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"itertools 0.12.1",
"log",
"once_cell",
@@ -3077,7 +3220,7 @@ dependencies = [
"log",
"regex",
"sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "strum 0.26.2",
+ "strum 0.26.3",
]
[[package]]
@@ -3097,7 +3240,7 @@ dependencies = [
[[package]]
name = "datanode"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arrow-flight",
@@ -3142,20 +3285,21 @@ dependencies = [
"query",
"reqwest",
"serde",
+ "serde_json",
"servers",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
- "substrait 0.9.3",
+ "substrait 0.9.5",
"table",
"tokio",
- "toml 0.8.14",
+ "toml 0.8.19",
"tonic 0.11.0",
]
[[package]]
name = "datatypes"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"arrow",
"arrow-array",
@@ -3177,7 +3321,7 @@ dependencies = [
"paste",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
]
[[package]]
@@ -3254,13 +3398,13 @@ dependencies = [
[[package]]
name = "derive-new"
-version = "0.6.0"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad"
+checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -3271,7 +3415,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -3294,11 +3438,11 @@ dependencies = [
[[package]]
name = "derive_builder"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7"
+checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b"
dependencies = [
- "derive_builder_macro 0.20.0",
+ "derive_builder_macro 0.20.1",
]
[[package]]
@@ -3327,14 +3471,14 @@ dependencies = [
[[package]]
name = "derive_builder_core"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d"
+checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38"
dependencies = [
- "darling 0.20.9",
+ "darling 0.20.10",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -3359,12 +3503,44 @@ dependencies = [
[[package]]
name = "derive_builder_macro"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b"
+checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc"
dependencies = [
- "derive_builder_core 0.20.0",
- "syn 2.0.66",
+ "derive_builder_core 0.20.1",
+ "syn 2.0.79",
+]
+
+[[package]]
+name = "derive_more"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05"
+dependencies = [
+ "derive_more-impl",
+]
+
+[[package]]
+name = "derive_more-impl"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.79",
+ "unicode-xid",
+]
+
+[[package]]
+name = "derive_utils"
+version = "0.14.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "65f152f4b8559c4da5d574bafc7af85454d706b4c5fe8b530d508cacbb6807ea"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.79",
]
[[package]]
@@ -3447,17 +3623,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "displaydoc"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.66",
-]
-
[[package]]
name = "dlv-list"
version = "0.3.0"
@@ -3515,6 +3680,12 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
+[[package]]
+name = "dunce"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
+
[[package]]
name = "duration-str"
version = "0.11.2"
@@ -3526,7 +3697,7 @@ dependencies = [
"serde",
"thiserror",
"time",
- "winnow 0.6.13",
+ "winnow 0.6.20",
]
[[package]]
@@ -3537,9 +3708,9 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
[[package]]
name = "either"
-version = "1.12.0"
+version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b"
+checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "ena"
@@ -3573,14 +3744,14 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
[[package]]
name = "enum-as-inner"
-version = "0.6.0"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a"
+checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc"
dependencies = [
- "heck 0.4.1",
+ "heck 0.5.0",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -3592,7 +3763,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -3717,9 +3888,9 @@ checksum = "59668941c55e5c186b8b58c391629af56774ec768f73c08bbcd56f09348eb00b"
[[package]]
name = "fastrand"
-version = "2.1.0"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
+checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
[[package]]
name = "fd-lock"
@@ -3734,7 +3905,7 @@ dependencies = [
[[package]]
name = "file-engine"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
@@ -3756,7 +3927,7 @@ dependencies = [
"object-store",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
"table",
"tokio",
@@ -3764,14 +3935,14 @@ dependencies = [
[[package]]
name = "filetime"
-version = "0.2.23"
+version = "0.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd"
+checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586"
dependencies = [
"cfg-if",
"libc",
- "redox_syscall 0.4.1",
- "windows-sys 0.52.0",
+ "libredox",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -3794,9 +3965,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
[[package]]
name = "flagset"
-version = "0.4.5"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdeb3aa5e95cf9aabc17f060cfa0ced7b83f042390760ca53bf09df9968acaa1"
+checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec"
[[package]]
name = "flatbuffers"
@@ -3810,9 +3981,9 @@ dependencies = [
[[package]]
name = "flate2"
-version = "1.0.30"
+version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae"
+checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0"
dependencies = [
"crc32fast",
"libz-sys",
@@ -3834,9 +4005,18 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28a80e3145d8ad11ba0995949bbcf48b9df2be62772b3d351ef017dff6ecb853"
+[[package]]
+name = "float_extras"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b22b70f8649ea2315955f1a36d964b0e4da482dfaa5f0d04df0d1fb7c338ab7a"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "flow"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arrow",
@@ -3890,10 +4070,10 @@ dependencies = [
"servers",
"session",
"smallvec",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
"strum 0.25.0",
- "substrait 0.9.3",
+ "substrait 0.9.5",
"table",
"tokio",
"tonic 0.11.0",
@@ -3914,6 +4094,21 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+[[package]]
+name = "foreign-types"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
+dependencies = [
+ "foreign-types-shared",
+]
+
+[[package]]
+name = "foreign-types-shared"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
+
[[package]]
name = "form_urlencoded"
version = "1.2.1"
@@ -3940,7 +4135,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa"
[[package]]
name = "frontend"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arc-swap",
@@ -3967,6 +4162,7 @@ dependencies = [
"common-test-util",
"common-time",
"common-version",
+ "datafusion-expr",
"datanode",
"datatypes",
"futures",
@@ -3988,14 +4184,14 @@ dependencies = [
"serde_json",
"servers",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)",
"store-api",
"strfmt",
"table",
"tokio",
- "toml 0.8.14",
+ "toml 0.8.19",
"tonic 0.11.0",
"tower",
"uuid",
@@ -4003,54 +4199,58 @@ dependencies = [
[[package]]
name = "frunk"
-version = "0.4.2"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11a351b59e12f97b4176ee78497dff72e4276fb1ceb13e19056aca7fa0206287"
+checksum = "874b6a17738fc273ec753618bac60ddaeac48cb1d7684c3e7bd472e57a28b817"
dependencies = [
"frunk_core",
"frunk_derives",
"frunk_proc_macros",
+ "serde",
]
[[package]]
name = "frunk_core"
-version = "0.4.2"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af2469fab0bd07e64ccf0ad57a1438f63160c69b2e57f04a439653d68eb558d6"
+checksum = "3529a07095650187788833d585c219761114005d5976185760cf794d265b6a5c"
+dependencies = [
+ "serde",
+]
[[package]]
name = "frunk_derives"
-version = "0.4.2"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e"
+checksum = "e99b8b3c28ae0e84b604c75f721c21dc77afb3706076af5e8216d15fd1deaae3"
dependencies = [
"frunk_proc_macro_helpers",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "frunk_proc_macro_helpers"
-version = "0.1.2"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35b54add839292b743aeda6ebedbd8b11e93404f902c56223e51b9ec18a13d2c"
+checksum = "05a956ef36c377977e512e227dcad20f68c2786ac7a54dacece3746046fea5ce"
dependencies = [
"frunk_core",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "frunk_proc_macros"
-version = "0.1.2"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71b85a1d4a9a6b300b41c05e8e13ef2feca03e0334127f29eca9506a7fe13a93"
+checksum = "67e86c2c9183662713fea27ea527aad20fb15fee635a71081ff91bf93df4dc51"
dependencies = [
"frunk_core",
"frunk_proc_macro_helpers",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -4073,6 +4273,12 @@ dependencies = [
"windows-sys 0.52.0",
]
+[[package]]
+name = "fs_extra"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
+
[[package]]
name = "fsevent-sys"
version = "4.1.0"
@@ -4174,7 +4380,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -4238,7 +4444,7 @@ version = "0.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ff16065e5720f376fbced200a5ae0f47ace85fd70b7e54269790281353b6d61"
dependencies = [
- "approx",
+ "approx 0.5.1",
"num-traits",
"serde",
]
@@ -4287,9 +4493,9 @@ dependencies = [
[[package]]
name = "gimli"
-version = "0.29.0"
+version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
+checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64"
[[package]]
name = "git2"
@@ -4297,7 +4503,7 @@ version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"libc",
"libgit2-sys",
"log",
@@ -4310,10 +4516,22 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+[[package]]
+name = "gloo-timers"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "js-sys",
+ "wasm-bindgen",
+]
+
[[package]]
name = "greptime-proto"
version = "0.1.0"
-source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=973f49cde88a582fb65755cc572ebcf6fb93ccf7#973f49cde88a582fb65755cc572ebcf6fb93ccf7"
+source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=255f87a3318ace3f88a67f76995a0e14910983f4#255f87a3318ace3f88a67f76995a0e14910983f4"
dependencies = [
"prost 0.12.6",
"serde",
@@ -4336,7 +4554,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http 0.2.12",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"slab",
"tokio",
"tokio-util",
@@ -4398,6 +4616,12 @@ dependencies = [
"allocator-api2",
]
+[[package]]
+name = "hashbrown"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb"
+
[[package]]
name = "hashlink"
version = "0.8.4"
@@ -4498,6 +4722,12 @@ version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
+[[package]]
+name = "hermit-abi"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc"
+
[[package]]
name = "hex"
version = "0.4.3"
@@ -4598,9 +4828,9 @@ dependencies = [
[[package]]
name = "http-body"
-version = "1.0.0"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643"
+checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
dependencies = [
"bytes",
"http 1.1.0",
@@ -4615,7 +4845,7 @@ dependencies = [
"bytes",
"futures-util",
"http 1.1.0",
- "http-body 1.0.0",
+ "http-body 1.0.1",
"pin-project-lite",
]
@@ -4627,9 +4857,9 @@ checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f"
[[package]]
name = "httparse"
-version = "1.9.3"
+version = "1.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545"
+checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946"
[[package]]
name = "httpdate"
@@ -4649,7 +4879,7 @@ dependencies = [
"os_info",
"serde",
"serde_derive",
- "toml 0.8.14",
+ "toml 0.8.19",
"uuid",
]
@@ -4710,7 +4940,7 @@ dependencies = [
"proc-macro-crate 1.3.1",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -4725,7 +4955,7 @@ dependencies = [
"rust-sitter",
"rust-sitter-tool",
"slotmap",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -4734,7 +4964,7 @@ version = "0.6.2"
source = "git+https://github.com/GreptimeTeam/hydroflow.git?branch=main#b072ee026f97f8537165e1fb247101e0ab2fb320"
dependencies = [
"auto_impl",
- "clap 4.5.7",
+ "clap 4.5.19",
"data-encoding",
"itertools 0.10.5",
"prettyplease",
@@ -4744,7 +4974,7 @@ dependencies = [
"serde",
"serde_json",
"slotmap",
- "syn 2.0.66",
+ "syn 2.0.79",
"webbrowser",
]
@@ -4758,14 +4988,14 @@ dependencies = [
"proc-macro-crate 1.3.1",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "hyper"
-version = "0.14.29"
+version = "0.14.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33"
+checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9"
dependencies = [
"bytes",
"futures-channel",
@@ -4787,15 +5017,15 @@ dependencies = [
[[package]]
name = "hyper"
-version = "1.3.1"
+version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d"
+checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
"http 1.1.0",
- "http-body 1.0.0",
+ "http-body 1.0.1",
"httparse",
"itoa",
"pin-project-lite",
@@ -4814,11 +5044,11 @@ dependencies = [
"futures-util",
"headers 0.4.0",
"http 1.1.0",
- "hyper 1.3.1",
- "hyper-rustls 0.27.2",
+ "hyper 1.4.1",
+ "hyper-rustls",
"hyper-util",
"pin-project-lite",
- "rustls-native-certs",
+ "rustls-native-certs 0.7.3",
"tokio",
"tokio-rustls 0.26.0",
"tower-service",
@@ -4826,38 +5056,21 @@ dependencies = [
[[package]]
name = "hyper-rustls"
-version = "0.26.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c"
+version = "0.27.3"
+source = "git+https://github.com/GreptimeTeam/hyper-rustls#a951e03fb914f1830e244400472814d38775118d"
dependencies = [
"futures-util",
"http 1.1.0",
- "hyper 1.3.1",
- "hyper-util",
- "rustls 0.22.4",
- "rustls-pki-types",
- "tokio",
- "tokio-rustls 0.25.0",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.27.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155"
-dependencies = [
- "futures-util",
- "http 1.1.0",
- "hyper 1.3.1",
+ "hyper 1.4.1",
"hyper-util",
"log",
- "rustls 0.23.10",
- "rustls-native-certs",
+ "rustls 0.23.13",
+ "rustls-native-certs 0.8.0",
"rustls-pki-types",
"tokio",
"tokio-rustls 0.26.0",
"tower-service",
+ "webpki-roots 0.26.6",
]
[[package]]
@@ -4866,7 +5079,7 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
dependencies = [
- "hyper 0.14.29",
+ "hyper 0.14.30",
"pin-project-lite",
"tokio",
"tokio-io-timeout",
@@ -4878,7 +5091,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793"
dependencies = [
- "hyper 1.3.1",
+ "hyper 1.4.1",
"hyper-util",
"pin-project-lite",
"tokio",
@@ -4887,29 +5100,28 @@ dependencies = [
[[package]]
name = "hyper-util"
-version = "0.1.5"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56"
+checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
"http 1.1.0",
- "http-body 1.0.0",
- "hyper 1.3.1",
+ "http-body 1.0.1",
+ "hyper 1.4.1",
"pin-project-lite",
"socket2 0.5.7",
"tokio",
- "tower",
"tower-service",
"tracing",
]
[[package]]
name = "iana-time-zone"
-version = "0.1.60"
+version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141"
+checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
@@ -4928,124 +5140,6 @@ dependencies = [
"cc",
]
-[[package]]
-name = "icu_collections"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526"
-dependencies = [
- "displaydoc",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locid"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locid_transform"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e"
-dependencies = [
- "displaydoc",
- "icu_locid",
- "icu_locid_transform_data",
- "icu_provider",
- "tinystr",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locid_transform_data"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e"
-
-[[package]]
-name = "icu_normalizer"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f"
-dependencies = [
- "displaydoc",
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "utf16_iter",
- "utf8_iter",
- "write16",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516"
-
-[[package]]
-name = "icu_properties"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036"
-dependencies = [
- "displaydoc",
- "icu_collections",
- "icu_locid_transform",
- "icu_properties_data",
- "icu_provider",
- "tinystr",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569"
-
-[[package]]
-name = "icu_provider"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9"
-dependencies = [
- "displaydoc",
- "icu_locid",
- "icu_provider_macros",
- "stable_deref_trait",
- "tinystr",
- "writeable",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_provider_macros"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.66",
-]
-
[[package]]
name = "ident_case"
version = "1.0.1"
@@ -5054,14 +5148,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
-version = "1.0.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed"
+checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
dependencies = [
- "icu_normalizer",
- "icu_properties",
- "smallvec",
- "utf8_iter",
+ "unicode-bidi",
+ "unicode-normalization",
]
[[package]]
@@ -5072,18 +5164,18 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed"
[[package]]
name = "include_dir"
-version = "0.7.3"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e"
+checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd"
dependencies = [
"include_dir_macros",
]
[[package]]
name = "include_dir_macros"
-version = "0.7.3"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f"
+checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75"
dependencies = [
"proc-macro2",
"quote",
@@ -5091,7 +5183,7 @@ dependencies = [
[[package]]
name = "index"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-trait",
"asynchronous-codec",
@@ -5111,9 +5203,9 @@ dependencies = [
"prost 0.12.6",
"rand",
"regex",
- "regex-automata 0.4.7",
+ "regex-automata 0.4.8",
"serde",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tantivy",
"tantivy-jieba",
"tempfile",
@@ -5135,12 +5227,12 @@ dependencies = [
[[package]]
name = "indexmap"
-version = "2.2.6"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
+checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da"
dependencies = [
"equivalent",
- "hashbrown 0.14.5",
+ "hashbrown 0.15.0",
"serde",
]
@@ -5152,12 +5244,12 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
[[package]]
name = "inferno"
-version = "0.11.19"
+version = "0.11.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "321f0f839cd44a4686e9504b0a62b4d69a50b62072144c71c68f5873c167b8d9"
+checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88"
dependencies = [
"ahash 0.8.11",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"is-terminal",
"itoa",
"log",
@@ -5171,7 +5263,7 @@ dependencies = [
[[package]]
name = "influxdb_line_protocol"
version = "0.1.0"
-source = "git+https://github.com/evenyag/influxdb_iox?branch=feat/line-protocol#10ef0d0b02705ac7518717390939fa3a9bcfcacc"
+source = "git+https://github.com/evenyag/influxdb_iox?branch=feat%2Fline-protocol#10ef0d0b02705ac7518717390939fa3a9bcfcacc"
dependencies = [
"bytes",
"nom",
@@ -5229,9 +5321,9 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02"
[[package]]
name = "integer-encoding"
-version = "4.0.0"
+version = "4.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "924df4f0e24e2e7f9cdd90babb0b96f93b20f3ecfa949ea9e6613756b8c8e1bf"
+checksum = "0d762194228a2f1c11063e46e32e5acb96e66e906382b9eb5441f2e0504bbd5a"
[[package]]
name = "inventory"
@@ -5240,16 +5332,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767"
[[package]]
-name = "ipnet"
-version = "2.9.0"
+name = "io-enum"
+version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
+checksum = "53b53d712d99a73eec59ee5e4fe6057f8052142d38eeafbbffcb06b36d738a6e"
+dependencies = [
+ "derive_utils",
+]
+
+[[package]]
+name = "ipnet"
+version = "2.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4"
[[package]]
name = "iri-string"
-version = "0.7.2"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f5f6c2df22c009ac44f6f1499308e7a3ac7ba42cd2378475cc691510e1eef1b"
+checksum = "44bd7eced44cfe2cebc674adb2a7124a754a4b5269288d22e9f39f8fada3562d"
dependencies = [
"memchr",
"serde",
@@ -5270,11 +5371,11 @@ dependencies = [
[[package]]
name = "is-terminal"
-version = "0.4.12"
+version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b"
+checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b"
dependencies = [
- "hermit-abi 0.3.9",
+ "hermit-abi 0.4.0",
"libc",
"windows-sys 0.52.0",
]
@@ -5287,9 +5388,9 @@ checksum = "06d198e9919d9822d5f7083ba8530e04de87841eaf21ead9af8f2304efd57c89"
[[package]]
name = "is_terminal_polyfill"
-version = "1.70.0"
+version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
+checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "iso8601"
@@ -5349,7 +5450,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1e2b0210dc78b49337af9e49d7ae41a39dceac6e5985613f1cf7763e2f76a25"
dependencies = [
"cedarwood",
- "derive_builder 0.20.0",
+ "derive_builder 0.20.1",
"fxhash",
"lazy_static",
"phf",
@@ -5381,18 +5482,18 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]]
name = "jobserver"
-version = "0.1.31"
+version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e"
+checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
dependencies = [
"libc",
]
[[package]]
name = "js-sys"
-version = "0.3.69"
+version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
+checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
dependencies = [
"wasm-bindgen",
]
@@ -5423,13 +5524,13 @@ dependencies = [
[[package]]
name = "jsonb"
version = "0.4.1"
-source = "git+https://github.com/CookiePieWw/jsonb.git?rev=d0166c130fce903bf6c58643417a3173a6172d31#d0166c130fce903bf6c58643417a3173a6172d31"
+source = "git+https://github.com/databendlabs/jsonb.git?rev=46ad50fc71cf75afbf98eec455f7892a6387c1fc#46ad50fc71cf75afbf98eec455f7892a6387c1fc"
dependencies = [
"byteorder",
"fast-float",
"itoa",
"nom",
- "ordered-float 4.2.0",
+ "ordered-float 4.3.0",
"rand",
"ryu",
"serde_json",
@@ -5469,7 +5570,7 @@ checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f"
dependencies = [
"base64 0.21.7",
"js-sys",
- "pem",
+ "pem 3.0.4",
"ring 0.17.8",
"serde",
"serde_json",
@@ -5504,7 +5605,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ee7893dab2e44ae5f9d0173f26ff4aa327c10b01b06a72b52dd9405b628640d"
dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
]
[[package]]
@@ -5529,9 +5630,9 @@ dependencies = [
[[package]]
name = "kube"
-version = "0.92.0"
+version = "0.92.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12dc4487eda98835dcaa7ac92a14165446db29dbd67a743c79fe9f41bf38ee72"
+checksum = "231c5a5392d9e2a9b0d923199760d3f1dd73b95288f2871d16c7c90ba4954506"
dependencies = [
"k8s-openapi",
"kube-client",
@@ -5542,9 +5643,9 @@ dependencies = [
[[package]]
name = "kube-client"
-version = "0.92.0"
+version = "0.92.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "408f35eab36927d3b883e4ad54c3080ea8c49f899ac84a7856e7182e4ee3b392"
+checksum = "8f4bf54135062ff60e2a0dfb3e7a9c8e931fc4a535b4d6bd561e0a1371321c61"
dependencies = [
"base64 0.22.1",
"bytes",
@@ -5553,19 +5654,19 @@ dependencies = [
"futures",
"home",
"http 1.1.0",
- "http-body 1.0.0",
+ "http-body 1.0.1",
"http-body-util",
- "hyper 1.3.1",
+ "hyper 1.4.1",
"hyper-http-proxy",
- "hyper-rustls 0.27.2",
+ "hyper-rustls",
"hyper-timeout 0.5.1",
"hyper-util",
"jsonpath-rust",
"k8s-openapi",
"kube-core",
- "pem",
- "rustls 0.23.10",
- "rustls-pemfile 2.1.2",
+ "pem 3.0.4",
+ "rustls 0.23.13",
+ "rustls-pemfile 2.2.0",
"secrecy",
"serde",
"serde_json",
@@ -5580,9 +5681,9 @@ dependencies = [
[[package]]
name = "kube-core"
-version = "0.92.0"
+version = "0.92.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f776624097c1e09e72eb1e9e0c2bb5d17d97c27a6a87734390a9fba246a8f67f"
+checksum = "40fb9bd8141cbc0fe6b0d9112d371679b4cb607b45c31dd68d92e40864a12975"
dependencies = [
"chrono",
"form_urlencoded",
@@ -5597,22 +5698,22 @@ dependencies = [
[[package]]
name = "kube-derive"
-version = "0.92.0"
+version = "0.92.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ae07adfd7d21b7fa582789206391243f98e155b46c806eb494839569853bcfd"
+checksum = "08fc86f70076921fdf2f433bbd2a796dc08ac537dc1db1f062cfa63ed4fa15fb"
dependencies = [
- "darling 0.20.9",
+ "darling 0.20.10",
"proc-macro2",
"quote",
"serde_json",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "kube-runtime"
-version = "0.92.0"
+version = "0.92.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12e5933f2d429f3a05d4cb67f935b25c94a133b0baeb558ab3917c270a11f6ef"
+checksum = "b7eb2fb986f81770eb55ec7f857e197019b31b38768d2410f6c1046ffac34225"
dependencies = [
"ahash 0.8.11",
"async-broadcast",
@@ -5678,12 +5779,35 @@ dependencies = [
]
[[package]]
-name = "lazy_static"
-version = "1.4.0"
+name = "lazy-regex"
+version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda"
dependencies = [
- "spin 0.5.2",
+ "lazy-regex-proc_macros",
+ "once_cell",
+ "regex-lite",
+]
+
+[[package]]
+name = "lazy-regex-proc_macros"
+version = "3.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "regex",
+ "syn 2.0.79",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
+dependencies = [
+ "spin 0.9.8",
]
[[package]]
@@ -5698,6 +5822,15 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c2cdeb66e45e9f36bfad5bbdb4d2384e70936afbee843c6f6543f0c551ebb25"
+[[package]]
+name = "lexical"
+version = "6.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6"
+dependencies = [
+ "lexical-core",
+]
+
[[package]]
name = "lexical-core"
version = "0.8.5"
@@ -5764,9 +5897,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.155"
+version = "0.2.159"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
+checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
[[package]]
name = "libfuzzer-sys"
@@ -5803,12 +5936,12 @@ dependencies = [
[[package]]
name = "libloading"
-version = "0.8.3"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
+checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
dependencies = [
"cfg-if",
- "windows-targets 0.52.5",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -5823,8 +5956,9 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"libc",
+ "redox_syscall 0.5.7",
]
[[package]]
@@ -5840,9 +5974,9 @@ dependencies = [
[[package]]
name = "libz-sys"
-version = "1.1.18"
+version = "1.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e"
+checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472"
dependencies = [
"cc",
"libc",
@@ -5862,12 +5996,6 @@ version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
-[[package]]
-name = "litemap"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704"
-
[[package]]
name = "lock_api"
version = "0.4.12"
@@ -5880,13 +6008,13 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.21"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
+checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "log-store"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-stream",
"async-trait",
@@ -5918,7 +6046,7 @@ dependencies = [
"rskafka",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
"tokio",
"uuid",
@@ -5937,7 +6065,7 @@ dependencies = [
"num-traits",
"quote",
"regex",
- "regex-syntax 0.8.4",
+ "regex-syntax 0.8.5",
"serde",
"vergen",
]
@@ -5952,7 +6080,7 @@ dependencies = [
"cactus",
"cfgrammar",
"filetime",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"lazy_static",
"lrtable",
"num-traits",
@@ -5980,28 +6108,36 @@ dependencies = [
[[package]]
name = "lru"
-version = "0.12.3"
+version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc"
+checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909"
+dependencies = [
+ "hashbrown 0.12.3",
+]
+
+[[package]]
+name = "lru"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904"
dependencies = [
"hashbrown 0.14.5",
]
[[package]]
name = "lz4"
-version = "1.25.0"
+version = "1.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6eab492fe7f8651add23237ea56dbf11b3c4ff762ab83d40a47f11433421f91"
+checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725"
dependencies = [
- "libc",
"lz4-sys",
]
[[package]]
name = "lz4-sys"
-version = "1.9.5"
+version = "1.11.1+lz4-1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9764018d143cc854c9f17f0b907de70f14393b1f502da6375dce70f00514eb3"
+checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6"
dependencies = [
"cc",
"libc",
@@ -6100,9 +6236,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]]
name = "matrixmultiply"
-version = "0.3.8"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2"
+checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a"
dependencies = [
"autocfg",
"rawpointer",
@@ -6162,9 +6298,9 @@ dependencies = [
[[package]]
name = "memmap2"
-version = "0.9.4"
+version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322"
+checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f"
dependencies = [
"libc",
]
@@ -6198,7 +6334,7 @@ dependencies = [
[[package]]
name = "meta-client"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
@@ -6213,7 +6349,7 @@ dependencies = [
"meta-srv",
"rand",
"serde",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tokio",
"tokio-stream",
"tonic 0.11.0",
@@ -6224,12 +6360,12 @@ dependencies = [
[[package]]
name = "meta-srv"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
"chrono",
- "clap 4.5.7",
+ "clap 4.5.19",
"client",
"common-base",
"common-catalog",
@@ -6267,13 +6403,13 @@ dependencies = [
"serde_json",
"servers",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
"table",
"tokio",
"tokio-postgres",
"tokio-stream",
- "toml 0.8.14",
+ "toml 0.8.19",
"tonic 0.11.0",
"tower",
"tracing",
@@ -6285,9 +6421,9 @@ dependencies = [
[[package]]
name = "meter-core"
version = "0.1.0"
-source = "git+https://github.com/GreptimeTeam/greptime-meter.git?rev=80eb97c24c88af4dd9a86f8bbaf50e741d4eb8cd#80eb97c24c88af4dd9a86f8bbaf50e741d4eb8cd"
+source = "git+https://github.com/GreptimeTeam/greptime-meter.git?rev=a10facb353b41460eeb98578868ebf19c2084fac#a10facb353b41460eeb98578868ebf19c2084fac"
dependencies = [
- "anymap",
+ "anymap2",
"once_cell",
"parking_lot 0.12.3",
]
@@ -6295,14 +6431,14 @@ dependencies = [
[[package]]
name = "meter-macros"
version = "0.1.0"
-source = "git+https://github.com/GreptimeTeam/greptime-meter.git?rev=80eb97c24c88af4dd9a86f8bbaf50e741d4eb8cd#80eb97c24c88af4dd9a86f8bbaf50e741d4eb8cd"
+source = "git+https://github.com/GreptimeTeam/greptime-meter.git?rev=a10facb353b41460eeb98578868ebf19c2084fac#a10facb353b41460eeb98578868ebf19c2084fac"
dependencies = [
"meter-core",
]
[[package]]
name = "metric-engine"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"aquamarine",
@@ -6324,7 +6460,7 @@ dependencies = [
"object-store",
"prometheus",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
"tokio",
]
@@ -6337,9 +6473,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "mime_guess"
-version = "2.0.4"
+version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef"
+checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
dependencies = [
"mime",
"unicase",
@@ -6362,11 +6498,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
-version = "0.7.3"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae"
+checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
dependencies = [
- "adler",
+ "adler2",
]
[[package]]
@@ -6391,9 +6527,21 @@ dependencies = [
"windows-sys 0.48.0",
]
+[[package]]
+name = "mio"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec"
+dependencies = [
+ "hermit-abi 0.3.9",
+ "libc",
+ "wasi",
+ "windows-sys 0.52.0",
+]
+
[[package]]
name = "mito2"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"aquamarine",
@@ -6450,14 +6598,14 @@ dependencies = [
"serde_with",
"session",
"smallvec",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
"strum 0.25.0",
"table",
"tokio",
"tokio-stream",
"tokio-util",
- "toml 0.8.14",
+ "toml 0.8.19",
"uuid",
]
@@ -6490,9 +6638,9 @@ dependencies = [
[[package]]
name = "moka"
-version = "0.12.7"
+version = "0.12.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08"
+checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f"
dependencies = [
"async-lock",
"async-trait",
@@ -6557,20 +6705,46 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b"
+[[package]]
+name = "mysql"
+version = "23.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05f11339ca5c251941805d51362a07823605a80586ced92914ab7de84fba813f"
+dependencies = [
+ "bufstream",
+ "bytes",
+ "crossbeam",
+ "flate2",
+ "io-enum",
+ "libc",
+ "lru 0.8.1",
+ "mysql_common 0.29.2",
+ "named_pipe",
+ "native-tls",
+ "once_cell",
+ "pem 1.1.1",
+ "percent-encoding",
+ "serde",
+ "serde_json",
+ "socket2 0.4.10",
+ "twox-hash",
+ "url",
+]
+
[[package]]
name = "mysql-common-derive"
version = "0.30.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56b0d8a0db9bf6d2213e11f2c701cb91387b0614361625ab7b9743b41aa4938f"
dependencies = [
- "darling 0.20.9",
+ "darling 0.20.10",
"heck 0.4.1",
"num-bigint",
"proc-macro-crate 1.3.1",
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
"termcolor",
"thiserror",
]
@@ -6581,14 +6755,14 @@ version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afe0450cc9344afff34915f8328600ab5ae19260802a334d0f72d2d5bdda3bfe"
dependencies = [
- "darling 0.20.9",
+ "darling 0.20.10",
"heck 0.4.1",
"num-bigint",
- "proc-macro-crate 3.1.0",
+ "proc-macro-crate 3.2.0",
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
"termcolor",
"thiserror",
]
@@ -6607,11 +6781,11 @@ dependencies = [
"futures-util",
"keyed_priority_queue",
"lazy_static",
- "lru",
- "mio",
+ "lru 0.12.4",
+ "mio 0.8.11",
"mysql_common 0.31.0",
"once_cell",
- "pem",
+ "pem 3.0.4",
"percent-encoding",
"pin-project",
"rand",
@@ -6630,6 +6804,43 @@ dependencies = [
"webpki-roots 0.25.4",
]
+[[package]]
+name = "mysql_common"
+version = "0.29.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9006c95034ccf7b903d955f210469119f6c3477fc9c9e7a7845ce38a3e665c2a"
+dependencies = [
+ "base64 0.13.1",
+ "bigdecimal 0.3.1",
+ "bindgen 0.59.2",
+ "bitflags 1.3.2",
+ "bitvec",
+ "byteorder",
+ "bytes",
+ "cc",
+ "cmake",
+ "crc32fast",
+ "flate2",
+ "frunk",
+ "lazy_static",
+ "lexical",
+ "num-bigint",
+ "num-traits",
+ "rand",
+ "regex",
+ "rust_decimal",
+ "saturating",
+ "serde",
+ "serde_json",
+ "sha1",
+ "sha2",
+ "smallvec",
+ "subprocess",
+ "thiserror",
+ "time",
+ "uuid",
+]
+
[[package]]
name = "mysql_common"
version = "0.31.0"
@@ -6637,9 +6848,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06f19e4cfa0ab5a76b627cec2d81331c49b034988eaf302c3bafeada684eadef"
dependencies = [
"base64 0.21.7",
- "bigdecimal",
- "bindgen",
- "bitflags 2.5.0",
+ "bigdecimal 0.4.5",
+ "bindgen 0.70.1",
+ "bitflags 2.6.0",
"bitvec",
"btoi",
"byteorder",
@@ -6676,9 +6887,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "478b0ff3f7d67b79da2b96f56f334431aef65e15ba4b29dd74a4236e29582bdc"
dependencies = [
"base64 0.21.7",
- "bigdecimal",
- "bindgen",
- "bitflags 2.5.0",
+ "bigdecimal 0.4.5",
+ "bindgen 0.70.1",
+ "bitflags 2.6.0",
"bitvec",
"btoi",
"byteorder",
@@ -6706,7 +6917,7 @@ dependencies = [
"thiserror",
"time",
"uuid",
- "zstd 0.13.1",
+ "zstd 0.13.2",
]
[[package]]
@@ -6715,7 +6926,7 @@ version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d506eb7e08d6329505faa8a3a00a5dcc6de9f76e0c77e4b75763ae3c770831ff"
dependencies = [
- "approx",
+ "approx 0.5.1",
"matrixmultiply",
"nalgebra-macros",
"num-complex",
@@ -6738,6 +6949,32 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "named_pipe"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ad9c443cce91fc3e12f017290db75dde490d685cdaaf508d7159d7cf41f0eb2b"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "native-tls"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466"
+dependencies = [
+ "libc",
+ "log",
+ "openssl",
+ "openssl-probe",
+ "openssl-sys",
+ "schannel",
+ "security-framework",
+ "security-framework-sys",
+ "tempfile",
+]
+
[[package]]
name = "ndk-context"
version = "0.1.1"
@@ -6792,7 +7029,7 @@ version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"cfg-if",
"cfg_aliases 0.1.1",
"libc",
@@ -6821,7 +7058,7 @@ version = "6.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"crossbeam-channel",
"filetime",
"fsevent-sys",
@@ -6829,7 +7066,7 @@ dependencies = [
"kqueue",
"libc",
"log",
- "mio",
+ "mio 0.8.11",
"walkdir",
"windows-sys 0.48.0",
]
@@ -6869,9 +7106,9 @@ dependencies = [
[[package]]
name = "num-bigint"
-version = "0.4.5"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7"
+checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
@@ -6917,7 +7154,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -7022,9 +7259,9 @@ dependencies = [
[[package]]
name = "object"
-version = "0.36.0"
+version = "0.36.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434"
+checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a"
dependencies = [
"memchr",
]
@@ -7040,7 +7277,7 @@ dependencies = [
[[package]]
name = "object-store"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"anyhow",
"bytes",
@@ -7079,9 +7316,12 @@ dependencies = [
[[package]]
name = "once_cell"
-version = "1.19.0"
+version = "1.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
+checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1"
+dependencies = [
+ "portable-atomic",
+]
[[package]]
name = "oneshot"
@@ -7091,15 +7331,15 @@ checksum = "e296cf87e61c9cfc1a61c3c63a0f7f286ed4554e0e22be84e8a38e1d264a2a29"
[[package]]
name = "oorandom"
-version = "11.1.3"
+version = "11.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
+checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9"
[[package]]
name = "opendal"
-version = "0.49.1"
+version = "0.49.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba615070686c8781ce97376fdafca29d7c42f47b31d2230d7c8c1642ec823950"
+checksum = "9b04d09b9822c2f75a1d2fc513a2c1279c70e91e7407936fffdf6a6976ec530a"
dependencies = [
"anyhow",
"async-trait",
@@ -7116,7 +7356,7 @@ dependencies = [
"md-5",
"once_cell",
"percent-encoding",
- "quick-xml 0.36.1",
+ "quick-xml 0.36.2",
"reqsign",
"reqwest",
"serde",
@@ -7141,17 +7381,43 @@ dependencies = [
[[package]]
name = "opensrv-mysql"
version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4148ab944991b0a33be74d2636a815268974578812a9e4cf7dc785325e858154"
+source = "git+https://github.com/datafuselabs/opensrv?rev=6bbc3b65e6b19212c4f7fc4f40c20daf6f452deb#6bbc3b65e6b19212c4f7fc4f40c20daf6f452deb"
dependencies = [
"async-trait",
"byteorder",
+ "bytes",
"chrono",
"mysql_common 0.32.4",
"nom",
"pin-project-lite",
"tokio",
- "tokio-rustls 0.25.0",
+ "tokio-rustls 0.26.0",
+]
+
+[[package]]
+name = "openssl"
+version = "0.10.66"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1"
+dependencies = [
+ "bitflags 2.6.0",
+ "cfg-if",
+ "foreign-types",
+ "libc",
+ "once_cell",
+ "openssl-macros",
+ "openssl-sys",
+]
+
+[[package]]
+name = "openssl-macros"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.79",
]
[[package]]
@@ -7160,6 +7426,18 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
+[[package]]
+name = "openssl-sys"
+version = "0.9.103"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
+dependencies = [
+ "cc",
+ "libc",
+ "pkg-config",
+ "vcpkg",
+]
+
[[package]]
name = "opentelemetry"
version = "0.21.0"
@@ -7168,7 +7446,7 @@ checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a"
dependencies = [
"futures-core",
"futures-sink",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"js-sys",
"once_cell",
"pin-project-lite",
@@ -7228,9 +7506,11 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4"
dependencies = [
+ "hex",
"opentelemetry 0.22.0",
"opentelemetry_sdk 0.22.1",
"prost 0.12.6",
+ "serde",
"tonic 0.11.0",
]
@@ -7257,7 +7537,7 @@ dependencies = [
"glob",
"once_cell",
"opentelemetry 0.21.0",
- "ordered-float 4.2.0",
+ "ordered-float 4.3.0",
"percent-encoding",
"rand",
"thiserror",
@@ -7279,15 +7559,16 @@ dependencies = [
"glob",
"once_cell",
"opentelemetry 0.22.0",
- "ordered-float 4.2.0",
+ "ordered-float 4.3.0",
"percent-encoding",
"rand",
+ "serde_json",
"thiserror",
]
[[package]]
name = "operator"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
@@ -7328,11 +7609,11 @@ dependencies = [
"regex",
"serde_json",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)",
"store-api",
- "substrait 0.9.3",
+ "substrait 0.9.5",
"table",
"tokio",
"tokio-util",
@@ -7391,9 +7672,9 @@ dependencies = [
[[package]]
name = "ordered-float"
-version = "4.2.0"
+version = "4.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e"
+checksum = "44d501f1a72f71d3c063a6bbc8f7271fa73aa09fe5d6283b6571e2ed176a2537"
dependencies = [
"num-traits",
]
@@ -7481,9 +7762,9 @@ dependencies = [
[[package]]
name = "parking"
-version = "2.2.0"
+version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
[[package]]
name = "parking_lot"
@@ -7530,10 +7811,10 @@ dependencies = [
"cfg-if",
"libc",
"petgraph",
- "redox_syscall 0.5.2",
+ "redox_syscall 0.5.7",
"smallvec",
"thread-id",
- "windows-targets 0.52.5",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -7568,7 +7849,7 @@ dependencies = [
"thrift",
"tokio",
"twox-hash",
- "zstd 0.13.1",
+ "zstd 0.13.2",
]
[[package]]
@@ -7582,7 +7863,7 @@ dependencies = [
[[package]]
name = "partition"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
@@ -7596,7 +7877,7 @@ dependencies = [
"itertools 0.10.5",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)",
"store-api",
@@ -7668,6 +7949,21 @@ dependencies = [
"hmac",
]
+[[package]]
+name = "peeking_take_while"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
+
+[[package]]
+name = "pem"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8"
+dependencies = [
+ "base64 0.13.1",
+]
+
[[package]]
name = "pem"
version = "3.0.4"
@@ -7710,9 +8006,9 @@ checksum = "df202b0b0f5b8e389955afd5f27b007b00fb948162953f1db9c70d2c7e3157d7"
[[package]]
name = "pest"
-version = "2.7.10"
+version = "2.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8"
+checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9"
dependencies = [
"memchr",
"thiserror",
@@ -7721,9 +8017,9 @@ dependencies = [
[[package]]
name = "pest_derive"
-version = "2.7.10"
+version = "2.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459"
+checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0"
dependencies = [
"pest",
"pest_generator",
@@ -7731,22 +8027,22 @@ dependencies = [
[[package]]
name = "pest_generator"
-version = "2.7.10"
+version = "2.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687"
+checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e"
dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "pest_meta"
-version = "2.7.10"
+version = "2.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd"
+checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f"
dependencies = [
"once_cell",
"pest",
@@ -7760,34 +8056,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
dependencies = [
"fixedbitset",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
]
[[package]]
name = "pgwire"
-version = "0.20.0"
+version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c00492c52bb65e0421211b7f4c5d9de7586e53786a3b244efb00f74851206bf6"
+checksum = "5e63bc3945a17010ff93677589c656c5e8fb4183b00bc86360de8e187d2a86cb"
dependencies = [
"async-trait",
- "base64 0.22.1",
"bytes",
"chrono",
- "derive-new 0.6.0",
+ "derive-new 0.7.0",
"futures",
"hex",
- "log",
+ "lazy-regex",
"md5",
"postgres-types",
"rand",
"ring 0.17.8",
- "stringprep",
+ "rust_decimal",
"thiserror",
- "time",
"tokio",
- "tokio-rustls 0.25.0",
+ "tokio-rustls 0.26.0",
"tokio-util",
- "x509-certificate",
]
[[package]]
@@ -7854,7 +8147,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -7871,7 +8164,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pipeline"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"ahash 0.8.11",
"api",
@@ -7904,6 +8197,7 @@ dependencies = [
"futures",
"greptime-proto",
"itertools 0.10.5",
+ "jsonb",
"lazy_static",
"moka",
"once_cell",
@@ -7917,7 +8211,7 @@ dependencies = [
"serde",
"serde_json",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"table",
"tokio",
@@ -7927,9 +8221,9 @@ dependencies = [
[[package]]
name = "piper"
-version = "0.2.3"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391"
+checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
dependencies = [
"atomic-waker",
"fastrand",
@@ -7998,15 +8292,15 @@ dependencies = [
[[package]]
name = "pkg-config"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
+checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
[[package]]
name = "plotters"
-version = "0.3.6"
+version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3"
+checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747"
dependencies = [
"num-traits",
"plotters-backend",
@@ -8017,29 +8311,30 @@ dependencies = [
[[package]]
name = "plotters-backend"
-version = "0.3.6"
+version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7"
+checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a"
[[package]]
name = "plotters-svg"
-version = "0.3.6"
+version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705"
+checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670"
dependencies = [
"plotters-backend",
]
[[package]]
name = "plugins"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"auth",
"common-base",
"datanode",
"frontend",
"meta-srv",
- "snafu 0.8.4",
+ "serde",
+ "snafu 0.8.5",
]
[[package]]
@@ -8055,9 +8350,9 @@ dependencies = [
[[package]]
name = "portable-atomic"
-version = "1.6.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
+checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2"
[[package]]
name = "postgres-protocol"
@@ -8079,9 +8374,9 @@ dependencies = [
[[package]]
name = "postgres-types"
-version = "0.2.7"
+version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02048d9e032fb3cc3413bbf7b83a15d84a5d419778e2628751896d856498eee9"
+checksum = "f66ea23a2d0e5734297357705193335e0a957696f34bed2f2faefacb2fec336f"
dependencies = [
"array-init",
"bytes",
@@ -8127,9 +8422,12 @@ dependencies = [
[[package]]
name = "ppv-lite86"
-version = "0.2.17"
+version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
+dependencies = [
+ "zerocopy",
+]
[[package]]
name = "precomputed-hash"
@@ -8153,15 +8451,15 @@ dependencies = [
[[package]]
name = "predicates-core"
-version = "1.0.6"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174"
+checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931"
[[package]]
name = "predicates-tree"
-version = "1.0.9"
+version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf"
+checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13"
dependencies = [
"predicates-core",
"termtree",
@@ -8169,9 +8467,9 @@ dependencies = [
[[package]]
name = "pretty_assertions"
-version = "1.4.0"
+version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66"
+checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d"
dependencies = [
"diff",
"yansi",
@@ -8189,12 +8487,12 @@ dependencies = [
[[package]]
name = "prettyplease"
-version = "0.2.20"
+version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e"
+checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba"
dependencies = [
"proc-macro2",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -8209,11 +8507,11 @@ dependencies = [
[[package]]
name = "proc-macro-crate"
-version = "3.1.0"
+version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284"
+checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b"
dependencies = [
- "toml_edit 0.21.1",
+ "toml_edit 0.22.22",
]
[[package]]
@@ -8242,9 +8540,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.85"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23"
+checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-ident",
]
@@ -8255,7 +8553,7 @@ version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"hex",
"lazy_static",
"procfs-core",
@@ -8268,7 +8566,7 @@ version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"hex",
]
@@ -8303,7 +8601,7 @@ dependencies = [
[[package]]
name = "promql"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"ahash 0.8.11",
"async-trait",
@@ -8323,21 +8621,24 @@ dependencies = [
"prost 0.12.6",
"query",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tokio",
]
[[package]]
name = "promql-parser"
-version = "0.4.0"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "007a331efb31f6ddb644590ef22359c9469784931162aad92599e34bcfa66583"
+checksum = "7fe99e6f80a79abccf1e8fb48dd63473a36057e600cc6ea36147c8318698ae6f"
dependencies = [
"cfgrammar",
+ "chrono",
"lazy_static",
"lrlex",
"lrpar",
"regex",
+ "serde",
+ "serde_json",
]
[[package]]
@@ -8362,12 +8663,12 @@ dependencies = [
[[package]]
name = "prost"
-version = "0.13.1"
+version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc"
+checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f"
dependencies = [
"bytes",
- "prost-derive 0.13.1",
+ "prost-derive 0.13.3",
]
[[package]]
@@ -8387,15 +8688,15 @@ dependencies = [
"prost 0.12.6",
"prost-types 0.12.6",
"regex",
- "syn 2.0.66",
+ "syn 2.0.79",
"tempfile",
]
[[package]]
name = "prost-build"
-version = "0.13.1"
+version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1"
+checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15"
dependencies = [
"bytes",
"heck 0.5.0",
@@ -8404,8 +8705,8 @@ dependencies = [
"multimap",
"once_cell",
"petgraph",
- "prost 0.13.1",
- "prost-types 0.13.1",
+ "prost 0.13.3",
+ "prost-types 0.13.3",
"regex",
"tempfile",
]
@@ -8433,20 +8734,20 @@ dependencies = [
"itertools 0.12.1",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "prost-derive"
-version = "0.13.1"
+version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca"
+checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5"
dependencies = [
"anyhow",
"itertools 0.13.0",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -8469,11 +8770,11 @@ dependencies = [
[[package]]
name = "prost-types"
-version = "0.13.1"
+version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2"
+checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670"
dependencies = [
- "prost 0.13.1",
+ "prost 0.13.3",
]
[[package]]
@@ -8538,14 +8839,14 @@ dependencies = [
[[package]]
name = "puffin"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
- "async-compression 0.4.11",
+ "async-compression 0.4.13",
"async-trait",
"async-walkdir",
"auto_impl",
"base64 0.21.7",
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"common-error",
"common-macro",
"common-runtime",
@@ -8559,7 +8860,7 @@ dependencies = [
"serde",
"serde_json",
"sha2",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"tokio",
"tokio-util",
"uuid",
@@ -8627,7 +8928,7 @@ dependencies = [
"proc-macro2",
"pyo3-macros-backend",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -8640,7 +8941,7 @@ dependencies = [
"proc-macro2",
"pyo3-build-config",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -8660,7 +8961,7 @@ dependencies = [
[[package]]
name = "query"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"ahash 0.8.11",
"api",
@@ -8695,6 +8996,7 @@ dependencies = [
"datafusion-physical-expr",
"datafusion-sql",
"datatypes",
+ "fastrand",
"format_num",
"futures",
"futures-util",
@@ -8709,24 +9011,28 @@ dependencies = [
"object-store",
"once_cell",
"paste",
+ "pretty_assertions",
"prometheus",
"promql",
"promql-parser",
"prost 0.12.6",
"rand",
"regex",
+ "serde",
+ "serde_json",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)",
"statrs",
"stats-cli",
"store-api",
"streaming-stats",
- "substrait 0.9.3",
+ "substrait 0.9.5",
"table",
"tokio",
"tokio-stream",
+ "uuid",
]
[[package]]
@@ -8750,19 +9056,67 @@ dependencies = [
[[package]]
name = "quick-xml"
-version = "0.36.1"
+version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc"
+checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe"
dependencies = [
"memchr",
"serde",
]
[[package]]
-name = "quote"
-version = "1.0.36"
+name = "quinn"
+version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
+checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684"
+dependencies = [
+ "bytes",
+ "pin-project-lite",
+ "quinn-proto",
+ "quinn-udp",
+ "rustc-hash 2.0.0",
+ "rustls 0.23.13",
+ "socket2 0.5.7",
+ "thiserror",
+ "tokio",
+ "tracing",
+]
+
+[[package]]
+name = "quinn-proto"
+version = "0.11.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6"
+dependencies = [
+ "bytes",
+ "rand",
+ "ring 0.17.8",
+ "rustc-hash 2.0.0",
+ "rustls 0.23.13",
+ "slab",
+ "thiserror",
+ "tinyvec",
+ "tracing",
+]
+
+[[package]]
+name = "quinn-udp"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b"
+dependencies = [
+ "libc",
+ "once_cell",
+ "socket2 0.5.7",
+ "tracing",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.37"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2",
]
@@ -8859,12 +9213,23 @@ dependencies = [
]
[[package]]
-name = "raw-cpuid"
-version = "11.0.2"
+name = "ratelimit"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd"
+checksum = "6c1bb13e2dcfa2232ac6887157aad8d9b3fe4ca57f7c8d4938ff5ea9be742300"
dependencies = [
- "bitflags 2.5.0",
+ "clocksource",
+ "parking_lot 0.12.3",
+ "thiserror",
+]
+
+[[package]]
+name = "raw-cpuid"
+version = "11.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0"
+dependencies = [
+ "bitflags 2.6.0",
]
[[package]]
@@ -8910,27 +9275,18 @@ dependencies = [
[[package]]
name = "redox_syscall"
-version = "0.4.1"
+version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
+checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f"
dependencies = [
- "bitflags 1.3.2",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
-dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
]
[[package]]
name = "redox_users"
-version = "0.4.5"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891"
+checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
dependencies = [
"getrandom",
"libredox",
@@ -8954,19 +9310,19 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "regex"
-version = "1.10.5"
+version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
+checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8"
dependencies = [
"aho-corasick",
"memchr",
- "regex-automata 0.4.7",
- "regex-syntax 0.8.4",
+ "regex-automata 0.4.8",
+ "regex-syntax 0.8.5",
]
[[package]]
@@ -8980,15 +9336,21 @@ dependencies = [
[[package]]
name = "regex-automata"
-version = "0.4.7"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
+checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3"
dependencies = [
"aho-corasick",
"memchr",
- "regex-syntax 0.8.4",
+ "regex-syntax 0.8.5",
]
+[[package]]
+name = "regex-lite"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a"
+
[[package]]
name = "regex-syntax"
version = "0.6.29"
@@ -8997,9 +9359,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
-version = "0.8.4"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
+checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "regress"
@@ -9050,7 +9412,7 @@ dependencies = [
"rand",
"reqwest",
"rsa 0.9.6",
- "rust-ini 0.21.0",
+ "rust-ini 0.21.1",
"serde",
"serde_json",
"sha1",
@@ -9059,19 +9421,19 @@ dependencies = [
[[package]]
name = "reqwest"
-version = "0.12.4"
+version = "0.12.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10"
+checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b"
dependencies = [
"base64 0.22.1",
"bytes",
"futures-core",
"futures-util",
"http 1.1.0",
- "http-body 1.0.0",
+ "http-body 1.0.1",
"http-body-util",
- "hyper 1.3.1",
- "hyper-rustls 0.26.0",
+ "hyper 1.4.1",
+ "hyper-rustls",
"hyper-util",
"ipnet",
"js-sys",
@@ -9081,16 +9443,17 @@ dependencies = [
"once_cell",
"percent-encoding",
"pin-project-lite",
- "rustls 0.22.4",
- "rustls-native-certs",
- "rustls-pemfile 2.1.2",
+ "quinn",
+ "rustls 0.23.13",
+ "rustls-native-certs 0.8.0",
+ "rustls-pemfile 2.2.0",
"rustls-pki-types",
"serde",
"serde_json",
"serde_urlencoded",
- "sync_wrapper",
+ "sync_wrapper 1.0.1",
"tokio",
- "tokio-rustls 0.25.0",
+ "tokio-rustls 0.26.0",
"tokio-util",
"tower-service",
"url",
@@ -9098,8 +9461,8 @@ dependencies = [
"wasm-bindgen-futures",
"wasm-streams",
"web-sys",
- "webpki-roots 0.26.2",
- "winreg 0.52.0",
+ "webpki-roots 0.26.6",
+ "windows-registry",
]
[[package]]
@@ -9139,9 +9502,9 @@ dependencies = [
[[package]]
name = "rgb"
-version = "0.8.37"
+version = "0.8.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8"
+checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a"
dependencies = [
"bytemuck",
]
@@ -9178,9 +9541,9 @@ dependencies = [
[[package]]
name = "rkyv"
-version = "0.7.44"
+version = "0.7.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0"
+checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b"
dependencies = [
"bitvec",
"bytecheck",
@@ -9196,9 +9559,9 @@ dependencies = [
[[package]]
name = "rkyv_derive"
-version = "0.7.44"
+version = "0.7.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65"
+checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0"
dependencies = [
"proc-macro2",
"quote",
@@ -9285,18 +9648,18 @@ dependencies = [
"crc32c",
"flate2",
"futures",
- "integer-encoding 4.0.0",
+ "integer-encoding 4.0.2",
"lz4",
"parking_lot 0.12.3",
"rand",
"rsasl",
- "rustls 0.23.10",
+ "rustls 0.23.13",
"snap",
"thiserror",
"tokio",
"tokio-rustls 0.26.0",
"tracing",
- "zstd 0.13.1",
+ "zstd 0.13.2",
]
[[package]]
@@ -9319,13 +9682,13 @@ checksum = "4165dfae59a39dd41d8dec720d3cbfbc71f69744efb480a3920f5d4e0cc6798d"
dependencies = [
"cfg-if",
"glob",
- "proc-macro-crate 3.1.0",
+ "proc-macro-crate 3.2.0",
"proc-macro2",
"quote",
"regex",
"relative-path",
"rustc_version",
- "syn 2.0.66",
+ "syn 2.0.79",
"unicode-ident",
]
@@ -9337,7 +9700,7 @@ checksum = "b3a8fb4672e840a587a66fc577a5491375df51ddb88f2a2c2a792598c326fe14"
dependencies = [
"quote",
"rand",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -9360,7 +9723,7 @@ dependencies = [
"proc-macro2",
"quote",
"rust-embed-utils",
- "syn 2.0.66",
+ "syn 2.0.79",
"walkdir",
]
@@ -9386,9 +9749,9 @@ dependencies = [
[[package]]
name = "rust-ini"
-version = "0.21.0"
+version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d625ed57d8f49af6cfa514c42e1a71fadcff60eb0b1c517ff82fe41aa025b41"
+checksum = "4e310ef0e1b6eeb79169a1171daf9abcb87a2e17c03bee2c4bb100b55c75409f"
dependencies = [
"cfg-if",
"ordered-multimap 0.7.3",
@@ -9456,14 +9819,15 @@ dependencies = [
[[package]]
name = "rust_decimal"
-version = "1.35.0"
+version = "1.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a"
+checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555"
dependencies = [
"arrayvec",
"borsh",
"bytes",
"num-traits",
+ "postgres-types",
"rand",
"rkyv",
"serde",
@@ -9490,20 +9854,20 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
[[package]]
name = "rustc_version"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
dependencies = [
"semver",
]
[[package]]
name = "rustix"
-version = "0.38.34"
+version = "0.38.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
+checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"errno",
"libc",
"linux-raw-sys",
@@ -9543,34 +9907,46 @@ dependencies = [
"log",
"ring 0.17.8",
"rustls-pki-types",
- "rustls-webpki 0.102.4",
+ "rustls-webpki 0.102.8",
"subtle",
"zeroize",
]
[[package]]
name = "rustls"
-version = "0.23.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402"
+version = "0.23.13"
+source = "git+https://github.com/GreptimeTeam/rustls#e0917109155435821c4416d699babe749b597a03"
dependencies = [
"log",
"once_cell",
"ring 0.17.8",
"rustls-pki-types",
- "rustls-webpki 0.102.4",
+ "rustls-webpki 0.102.8",
"subtle",
"zeroize",
]
[[package]]
name = "rustls-native-certs"
-version = "0.7.1"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba"
+checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5"
dependencies = [
"openssl-probe",
- "rustls-pemfile 2.1.2",
+ "rustls-pemfile 2.2.0",
+ "rustls-pki-types",
+ "schannel",
+ "security-framework",
+]
+
+[[package]]
+name = "rustls-native-certs"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a"
+dependencies = [
+ "openssl-probe",
+ "rustls-pemfile 2.2.0",
"rustls-pki-types",
"schannel",
"security-framework",
@@ -9587,19 +9963,18 @@ dependencies = [
[[package]]
name = "rustls-pemfile"
-version = "2.1.2"
+version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d"
+checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"
dependencies = [
- "base64 0.22.1",
"rustls-pki-types",
]
[[package]]
name = "rustls-pki-types"
-version = "1.7.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d"
+checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55"
[[package]]
name = "rustls-webpki"
@@ -9613,9 +9988,9 @@ dependencies = [
[[package]]
name = "rustls-webpki"
-version = "0.102.4"
+version = "0.102.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e"
+checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9"
dependencies = [
"ring 0.17.8",
"rustls-pki-types",
@@ -9655,7 +10030,7 @@ source = "git+https://github.com/discord9/RustPython?rev=9ed5137412#9ed51374125b
dependencies = [
"ascii",
"bitflags 1.3.2",
- "bstr",
+ "bstr 0.2.17",
"cfg-if",
"hexf-parse",
"itertools 0.10.5",
@@ -9690,7 +10065,7 @@ version = "0.2.0"
source = "git+https://github.com/discord9/RustPython?rev=9ed5137412#9ed51374125b5f1a9e5cee5dd7e27023b8591f1e"
dependencies = [
"bitflags 1.3.2",
- "bstr",
+ "bstr 0.2.17",
"itertools 0.10.5",
"lz4_flex 0.9.5",
"num-bigint",
@@ -9843,7 +10218,7 @@ dependencies = [
"ascii",
"atty",
"bitflags 1.3.2",
- "bstr",
+ "bstr 0.2.17",
"caseless",
"cfg-if",
"chrono",
@@ -9902,7 +10277,7 @@ dependencies = [
"widestring",
"winapi",
"windows 0.39.0",
- "winreg 0.10.1",
+ "winreg",
]
[[package]]
@@ -9963,6 +10338,20 @@ version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
+[[package]]
+name = "s2"
+version = "0.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc7fbc04bb52c40b5f48c9bb2d2961375301916e0c25d9f373750654d588cd5c"
+dependencies = [
+ "bigdecimal 0.3.1",
+ "cgmath",
+ "float_extras",
+ "lazy_static",
+ "libm",
+ "serde",
+]
+
[[package]]
name = "safe-proc-macro2"
version = "1.0.67"
@@ -10045,11 +10434,11 @@ checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71"
[[package]]
name = "schannel"
-version = "0.1.23"
+version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534"
+checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b"
dependencies = [
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -10074,7 +10463,7 @@ dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -10085,7 +10474,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "script"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arc-swap",
@@ -10132,7 +10521,7 @@ dependencies = [
"serde",
"servers",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"table",
"tokio",
@@ -10175,7 +10564,7 @@ dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -10190,11 +10579,11 @@ dependencies = [
[[package]]
name = "security-framework"
-version = "2.11.0"
+version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0"
+checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"core-foundation",
"core-foundation-sys",
"libc",
@@ -10203,9 +10592,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
-version = "2.11.0"
+version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7"
+checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6"
dependencies = [
"core-foundation-sys",
"libc",
@@ -10228,9 +10617,9 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4"
[[package]]
name = "serde"
-version = "1.0.203"
+version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
+checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
dependencies = [
"serde_derive",
]
@@ -10247,13 +10636,13 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.203"
+version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
+checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -10264,16 +10653,16 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "serde_json"
-version = "1.0.122"
+version = "1.0.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da"
+checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"itoa",
"memchr",
"ryu",
@@ -10298,28 +10687,28 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "serde_spanned"
-version = "0.6.6"
+version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0"
+checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1"
dependencies = [
"serde",
]
[[package]]
name = "serde_tokenstream"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8790a7c3fe883e443eaa2af6f705952bc5d6e8671a220b9335c8cae92c037e74"
+checksum = "64060d864397305347a78851c51588fd283767e7e7589829e8121d65512340f1"
dependencies = [
"proc-macro2",
"quote",
"serde",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -10336,15 +10725,15 @@ dependencies = [
[[package]]
name = "serde_with"
-version = "3.8.1"
+version = "3.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20"
+checksum = "9720086b3357bcb44fce40117d769a4d068c70ecfa190850a980a71755f66fcc"
dependencies = [
"base64 0.22.1",
"chrono",
"hex",
"indexmap 1.9.3",
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"serde",
"serde_derive",
"serde_json",
@@ -10354,14 +10743,14 @@ dependencies = [
[[package]]
name = "serde_with_macros"
-version = "3.8.1"
+version = "3.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2"
+checksum = "5f1abbfe725f27678f4663bcacb75a83e829fd464c25d78dd038a3a29e307cec"
dependencies = [
- "darling 0.20.9",
+ "darling 0.20.10",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -10370,7 +10759,7 @@ version = "0.9.34+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"itoa",
"ryu",
"serde",
@@ -10379,8 +10768,9 @@ dependencies = [
[[package]]
name = "servers"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
+ "ahash 0.8.11",
"aide",
"api",
"arrow",
@@ -10389,6 +10779,7 @@ dependencies = [
"arrow-schema",
"async-trait",
"auth",
+ "aws-lc-sys",
"axum",
"axum-macros",
"base64 0.21.7",
@@ -10405,6 +10796,7 @@ dependencies = [
"common-mem-prof",
"common-meta",
"common-plugins",
+ "common-pprof",
"common-query",
"common-recordbatch",
"common-runtime",
@@ -10416,6 +10808,7 @@ dependencies = [
"dashmap",
"datafusion",
"datafusion-common",
+ "datafusion-expr",
"datatypes",
"derive_builder 0.12.0",
"futures",
@@ -10425,7 +10818,7 @@ dependencies = [
"http 0.2.12",
"http-body 0.4.6",
"humantime-serde",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"influxdb_line_protocol",
"itertools 0.10.5",
"jsonb",
@@ -10453,15 +10846,15 @@ dependencies = [
"regex",
"reqwest",
"rust-embed",
- "rustls 0.22.4",
- "rustls-pemfile 2.1.2",
+ "rustls 0.23.13",
+ "rustls-pemfile 2.2.0",
"rustls-pki-types",
"schemars",
"script",
"serde",
"serde_json",
"session",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"snap",
"sql",
"strum 0.25.0",
@@ -10471,7 +10864,7 @@ dependencies = [
"tokio",
"tokio-postgres",
"tokio-postgres-rustls",
- "tokio-rustls 0.25.0",
+ "tokio-rustls 0.26.0",
"tokio-stream",
"tokio-test",
"tokio-util",
@@ -10481,12 +10874,12 @@ dependencies = [
"tower-http 0.4.4",
"urlencoding",
"uuid",
- "zstd 0.13.1",
+ "zstd 0.13.2",
]
[[package]]
name = "session"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arc-swap",
@@ -10498,7 +10891,7 @@ dependencies = [
"common-time",
"derive_builder 0.12.0",
"meter-core",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
]
@@ -10547,9 +10940,9 @@ dependencies = [
[[package]]
name = "shadow-rs"
-version = "0.31.0"
+version = "0.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66caf2de9b7e61293c00006cd2807d6c4e4b31018c5ea21d008f44f4852b93c3"
+checksum = "2311e39772c00391875f40e34d43efef247b23930143a70ca5fbec9505937420"
dependencies = [
"const_format",
"git2",
@@ -10598,7 +10991,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0b7840f121a46d63066ee7a99fc81dcabbc6105e437cae43528cea199b5a05f"
dependencies = [
- "approx",
+ "approx 0.5.1",
"num-complex",
"num-traits",
"paste",
@@ -10607,9 +11000,29 @@ dependencies = [
[[package]]
name = "simdutf8"
-version = "0.1.4"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a"
+checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
+
+[[package]]
+name = "similar"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e"
+dependencies = [
+ "bstr 1.10.0",
+ "unicode-segmentation",
+]
+
+[[package]]
+name = "similar-asserts"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cfe85670573cd6f0fa97940f26e7e6601213c3b0555246c24234131f88c5709e"
+dependencies = [
+ "console",
+ "similar",
+]
[[package]]
name = "simple_asn1"
@@ -10684,11 +11097,11 @@ dependencies = [
[[package]]
name = "snafu"
-version = "0.8.4"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b835cb902660db3415a672d862905e791e54d306c6e8189168c7f3d9ae1c79d"
+checksum = "223891c85e2a29c3fe8fb900c1fae5e69c2e42415e3177752e8718475efa5019"
dependencies = [
- "snafu-derive 0.8.4",
+ "snafu-derive 0.8.5",
]
[[package]]
@@ -10705,14 +11118,14 @@ dependencies = [
[[package]]
name = "snafu-derive"
-version = "0.8.4"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38d1e02fca405f6280643174a50c942219f0bbf4dbf7d480f1dd864d6f211ae5"
+checksum = "03c3c6b7927ffe7ecaa769ee0e3994da3b8cafc8f444578982c83ecb161af917"
dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -10787,7 +11200,7 @@ dependencies = [
[[package]]
name = "sql"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"chrono",
@@ -10812,7 +11225,7 @@ dependencies = [
"lazy_static",
"regex",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)",
"sqlparser_derive 0.1.1",
"table",
@@ -10820,9 +11233,9 @@ dependencies = [
[[package]]
name = "sqlformat"
-version = "0.2.4"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f"
+checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790"
dependencies = [
"nom",
"unicode_categories",
@@ -10848,21 +11261,24 @@ dependencies = [
[[package]]
name = "sqlness-runner"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-trait",
- "clap 4.5.7",
+ "clap 4.5.19",
"client",
"common-error",
"common-query",
"common-recordbatch",
"common-time",
+ "datatypes",
+ "mysql",
"serde",
"serde_json",
"sqlness",
"tempfile",
"tinytemplate",
"tokio",
+ "tokio-postgres",
]
[[package]]
@@ -10906,7 +11322,7 @@ checksum = "01b2e185515564f15375f593fb966b5718bc624ba77fe49fa4616ad619690554"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -10916,7 +11332,7 @@ source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -11023,7 +11439,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1120e6a8cbd4d85d5532d2e8a245aef2128e1853981f8b6d9943264184843102"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"num_enum",
"optional",
]
@@ -11046,7 +11462,7 @@ version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b35a062dbadac17a42e0fc64c27f419b25d6fae98572eb43c8814c9e873d7721"
dependencies = [
- "approx",
+ "approx 0.5.1",
"lazy_static",
"nalgebra",
"num-traits",
@@ -11065,7 +11481,7 @@ dependencies = [
[[package]]
name = "store-api"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"aquamarine",
@@ -11083,9 +11499,10 @@ dependencies = [
"datatypes",
"derive_builder 0.12.0",
"futures",
+ "humantime",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"strum 0.25.0",
"tokio",
]
@@ -11176,9 +11593,9 @@ dependencies = [
[[package]]
name = "strum"
-version = "0.26.2"
+version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
+checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
dependencies = [
"strum_macros 0.26.4",
]
@@ -11206,7 +11623,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -11219,7 +11636,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -11234,7 +11651,7 @@ dependencies = [
[[package]]
name = "substrait"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"async-trait",
"bytes",
@@ -11248,7 +11665,7 @@ dependencies = [
"datatypes",
"promql",
"prost 0.12.6",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"substrait 0.37.3",
"tokio",
]
@@ -11272,7 +11689,7 @@ dependencies = [
"serde",
"serde_json",
"serde_yaml",
- "syn 2.0.66",
+ "syn 2.0.79",
"typify",
"walkdir",
]
@@ -11285,42 +11702,42 @@ checksum = "9ec889155c56a34200d2c5aee147b8d29545fa7cce7f68b38d927f5d24ced8ef"
dependencies = [
"heck 0.5.0",
"prettyplease",
- "prost 0.13.1",
- "prost-build 0.13.1",
- "prost-types 0.13.1",
+ "prost 0.13.3",
+ "prost-build 0.13.3",
+ "prost-types 0.13.3",
"schemars",
"semver",
"serde",
"serde_json",
"serde_yaml",
- "syn 2.0.66",
+ "syn 2.0.79",
"typify",
"walkdir",
]
[[package]]
name = "subtle"
-version = "2.5.0"
+version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "symbolic-common"
-version = "12.9.2"
+version = "12.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71297dc3e250f7dbdf8adb99e235da783d690f5819fdeb4cce39d9cfb0aca9f1"
+checksum = "366f1b4c6baf6cfefc234bbd4899535fca0b06c74443039a73f6dfb2fad88d77"
dependencies = [
"debugid",
- "memmap2 0.9.4",
+ "memmap2 0.9.5",
"stable_deref_trait",
"uuid",
]
[[package]]
name = "symbolic-demangle"
-version = "12.9.2"
+version = "12.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "424fa2c9bf2c862891b9cfd354a752751a6730fd838a4691e7f6c2c7957b9daf"
+checksum = "aba05ba5b9962ea5617baf556293720a8b2d0a282aa14ee4bf10e22efc7da8c8"
dependencies = [
"cpp_demangle",
"rustc-demangle",
@@ -11340,9 +11757,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.66"
+version = "2.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
+checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590"
dependencies = [
"proc-macro2",
"quote",
@@ -11377,7 +11794,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -11387,21 +11804,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
-name = "synstructure"
-version = "0.13.1"
+name = "sync_wrapper"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
+checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394"
dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.66",
+ "futures-core",
]
[[package]]
name = "sysinfo"
-version = "0.30.12"
+version = "0.30.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae"
+checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3"
dependencies = [
"cfg-if",
"core-foundation-sys",
@@ -11435,7 +11850,7 @@ dependencies = [
[[package]]
name = "table"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"async-trait",
@@ -11465,7 +11880,7 @@ dependencies = [
"paste",
"serde",
"serde_json",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"store-api",
"tokio",
"tokio-util",
@@ -11499,10 +11914,10 @@ dependencies = [
"itertools 0.12.1",
"levenshtein_automata",
"log",
- "lru",
+ "lru 0.12.4",
"lz4_flex 0.11.3",
"measure_time",
- "memmap2 0.9.4",
+ "memmap2 0.9.5",
"num_cpus",
"once_cell",
"oneshot",
@@ -11526,7 +11941,7 @@ dependencies = [
"time",
"uuid",
"winapi",
- "zstd 0.13.1",
+ "zstd 0.13.2",
]
[[package]]
@@ -11574,7 +11989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18"
dependencies = [
"byteorder",
- "regex-syntax 0.8.4",
+ "regex-syntax 0.8.5",
"utf8-ranges",
]
@@ -11607,7 +12022,7 @@ dependencies = [
"tantivy-bitpacker",
"tantivy-common",
"tantivy-fst",
- "zstd 0.13.1",
+ "zstd 0.13.2",
]
[[package]]
@@ -11638,9 +12053,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "target-lexicon"
-version = "0.12.14"
+version = "0.12.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
+checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "temp-env"
@@ -11653,14 +12068,15 @@ dependencies = [
[[package]]
name = "tempfile"
-version = "3.10.1"
+version = "3.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
+checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b"
dependencies = [
"cfg-if",
"fastrand",
+ "once_cell",
"rustix",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -11700,7 +12116,7 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
[[package]]
name = "tests-fuzz"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"arbitrary",
"async-trait",
@@ -11730,7 +12146,7 @@ dependencies = [
"serde",
"serde_json",
"serde_yaml",
- "snafu 0.8.4",
+ "snafu 0.8.5",
"sql",
"sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)",
"sqlx",
@@ -11742,7 +12158,7 @@ dependencies = [
[[package]]
name = "tests-integration"
-version = "0.9.3"
+version = "0.9.5"
dependencies = [
"api",
"arrow-flight",
@@ -11753,7 +12169,7 @@ dependencies = [
"cache",
"catalog",
"chrono",
- "clap 4.5.7",
+ "clap 4.5.19",
"client",
"cmd",
"common-base",
@@ -11775,6 +12191,7 @@ dependencies = [
"datanode",
"datatypes",
"dotenv",
+ "flate2",
"flow",
"frontend",
"futures",
@@ -11798,11 +12215,12 @@ dependencies = [
"serde_json",
"servers",
"session",
- "snafu 0.8.4",
+ "similar-asserts",
+ "snafu 0.8.5",
"sql",
"sqlx",
"store-api",
- "substrait 0.9.3",
+ "substrait 0.9.5",
"table",
"tempfile",
"time",
@@ -11813,7 +12231,7 @@ dependencies = [
"tower",
"url",
"uuid",
- "zstd 0.13.1",
+ "zstd 0.13.2",
]
[[package]]
@@ -11839,29 +12257,29 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
[[package]]
name = "thiserror"
-version = "1.0.63"
+version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
+checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.63"
+version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
+checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
name = "thread-id"
-version = "4.2.1"
+version = "4.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0ec81c46e9eb50deaa257be2f148adf052d1fb7701cfd55ccfab2525280b70b"
+checksum = "cfe8f25bbdd100db7e1d34acf7fd2dc59c4bf8f7483f505eaa7d4f12f76cc0ea"
dependencies = [
"libc",
"winapi",
@@ -11979,16 +12397,6 @@ dependencies = [
"log",
]
-[[package]]
-name = "tinystr"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f"
-dependencies = [
- "displaydoc",
- "zerovec",
-]
-
[[package]]
name = "tinytemplate"
version = "1.2.1"
@@ -12001,9 +12409,9 @@ dependencies = [
[[package]]
name = "tinyvec"
-version = "1.6.0"
+version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
+checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938"
dependencies = [
"tinyvec_macros",
]
@@ -12016,22 +12424,21 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.38.0"
+version = "1.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
+checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998"
dependencies = [
"backtrace",
"bytes",
"libc",
- "mio",
- "num_cpus",
+ "mio 1.0.2",
"parking_lot 0.12.3",
"pin-project-lite",
"signal-hook-registry",
"socket2 0.5.7",
"tokio-macros",
"tracing",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -12046,13 +12453,13 @@ dependencies = [
[[package]]
name = "tokio-macros"
-version = "2.3.0"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
+checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -12081,9 +12488,9 @@ dependencies = [
[[package]]
name = "tokio-postgres"
-version = "0.7.11"
+version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03adcf0147e203b6032c0b2d30be1415ba03bc348901f3ff1cc0df6a733e60c3"
+checksum = "3b5d3742945bc7d7f210693b0c58ae542c6fd47b17adbbda0885f3dcb34a6bdb"
dependencies = [
"async-trait",
"byteorder",
@@ -12107,16 +12514,15 @@ dependencies = [
[[package]]
name = "tokio-postgres-rustls"
-version = "0.11.1"
+version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ea13f22eda7127c827983bdaf0d7fff9df21c8817bab02815ac277a21143677"
+checksum = "04fb792ccd6bbcd4bba408eb8a292f70fc4a3589e5d793626f45190e6454b6ab"
dependencies = [
- "futures",
"ring 0.17.8",
- "rustls 0.22.4",
+ "rustls 0.23.13",
"tokio",
"tokio-postgres",
- "tokio-rustls 0.25.0",
+ "tokio-rustls 0.26.0",
"x509-certificate",
]
@@ -12155,19 +12561,18 @@ dependencies = [
[[package]]
name = "tokio-rustls"
version = "0.26.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4"
+source = "git+https://github.com/GreptimeTeam/tokio-rustls#4604ca6badfd1d10424718e5570cc481ab787fc8"
dependencies = [
- "rustls 0.23.10",
+ "rustls 0.23.13",
"rustls-pki-types",
"tokio",
]
[[package]]
name = "tokio-stream"
-version = "0.1.15"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af"
+checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1"
dependencies = [
"futures-core",
"pin-project-lite",
@@ -12190,9 +12595,9 @@ dependencies = [
[[package]]
name = "tokio-util"
-version = "0.7.11"
+version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1"
+checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a"
dependencies = [
"bytes",
"futures-core",
@@ -12214,21 +12619,21 @@ dependencies = [
[[package]]
name = "toml"
-version = "0.8.14"
+version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335"
+checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
- "toml_edit 0.22.14",
+ "toml_edit 0.22.22",
]
[[package]]
name = "toml_datetime"
-version = "0.6.6"
+version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf"
+checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
dependencies = [
"serde",
]
@@ -12239,33 +12644,22 @@ version = "0.19.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"toml_datetime",
"winnow 0.5.40",
]
[[package]]
name = "toml_edit"
-version = "0.21.1"
+version = "0.22.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
+checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5"
dependencies = [
- "indexmap 2.2.6",
- "toml_datetime",
- "winnow 0.5.40",
-]
-
-[[package]]
-name = "toml_edit"
-version = "0.22.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38"
-dependencies = [
- "indexmap 2.2.6",
+ "indexmap 2.6.0",
"serde",
"serde_spanned",
"toml_datetime",
- "winnow 0.6.13",
+ "winnow 0.6.20",
]
[[package]]
@@ -12283,7 +12677,7 @@ dependencies = [
"h2",
"http 0.2.12",
"http-body 0.4.6",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"hyper-timeout 0.4.1",
"percent-encoding",
"pin-project",
@@ -12311,12 +12705,12 @@ dependencies = [
"h2",
"http 0.2.12",
"http-body 0.4.6",
- "hyper 0.14.29",
+ "hyper 0.14.30",
"hyper-timeout 0.4.1",
"percent-encoding",
"pin-project",
"prost 0.12.6",
- "rustls-pemfile 2.1.2",
+ "rustls-pemfile 2.2.0",
"rustls-pki-types",
"tokio",
"tokio-rustls 0.25.0",
@@ -12338,7 +12732,7 @@ dependencies = [
"proc-macro2",
"prost-build 0.12.6",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -12381,9 +12775,9 @@ version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140"
dependencies = [
- "async-compression 0.4.11",
+ "async-compression 0.4.13",
"base64 0.21.7",
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"bytes",
"futures-core",
"futures-util",
@@ -12412,10 +12806,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5"
dependencies = [
"base64 0.21.7",
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"bytes",
"http 1.1.0",
- "http-body 1.0.0",
+ "http-body 1.0.1",
"http-body-util",
"mime",
"pin-project-lite",
@@ -12426,15 +12820,15 @@ dependencies = [
[[package]]
name = "tower-layer"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
+checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
[[package]]
name = "tower-service"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
@@ -12468,7 +12862,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -12671,9 +13065,9 @@ checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc"
[[package]]
name = "triomphe"
-version = "0.1.12"
+version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90"
+checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3"
[[package]]
name = "try-lock"
@@ -12694,9 +13088,9 @@ dependencies = [
[[package]]
name = "typeid"
-version = "1.0.0"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf"
+checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e"
[[package]]
name = "typenum"
@@ -12706,9 +13100,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
[[package]]
name = "typetag"
-version = "0.2.16"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "661d18414ec032a49ece2d56eee03636e43c4e8d577047ab334c0ba892e29aaf"
+checksum = "52ba3b6e86ffe0054b2c44f2d86407388b933b16cb0a70eea3929420db1d9bbe"
dependencies = [
"erased-serde",
"inventory",
@@ -12719,13 +13113,13 @@ dependencies = [
[[package]]
name = "typetag-impl"
-version = "0.2.16"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac73887f47b9312552aa90ef477927ff014d63d1920ca8037c6c1951eab64bb1"
+checksum = "70b20a22c42c8f1cd23ce5e34f165d4d37038f5b663ad20fb6adbdf029172483"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -12753,7 +13147,7 @@ dependencies = [
"semver",
"serde",
"serde_json",
- "syn 2.0.66",
+ "syn 2.0.79",
"thiserror",
"unicode-ident",
]
@@ -12771,7 +13165,7 @@ dependencies = [
"serde",
"serde_json",
"serde_tokenstream",
- "syn 2.0.66",
+ "syn 2.0.79",
"typify-impl",
]
@@ -12797,9 +13191,9 @@ dependencies = [
[[package]]
name = "tzdb_data"
-version = "0.1.2"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d1889fdffac09d65c1d95c42d5202e9b21ad8c758f426e9fe09088817ea998d6"
+checksum = "654c1ec546942ce0594e8d220e6b8e3899e0a0a8fe70ddd54d32a376dfefe3f8"
dependencies = [
"tz-rs",
]
@@ -12812,9 +13206,9 @@ checksum = "fe4fa6e588762366f1eb4991ce59ad1b93651d0b769dfb4e4d1c5c4b943d1159"
[[package]]
name = "ucd-trie"
-version = "0.1.6"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
+checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
[[package]]
name = "uname"
@@ -12952,9 +13346,9 @@ dependencies = [
[[package]]
name = "unicode-bidi"
-version = "0.3.15"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
+checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893"
[[package]]
name = "unicode-casing"
@@ -12964,42 +13358,42 @@ checksum = "623f59e6af2a98bdafeb93fa277ac8e1e40440973001ca15cf4ae1541cd16d56"
[[package]]
name = "unicode-ident"
-version = "1.0.12"
+version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
[[package]]
name = "unicode-normalization"
-version = "0.1.23"
+version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5"
+checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956"
dependencies = [
"tinyvec",
]
[[package]]
name = "unicode-properties"
-version = "0.1.1"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291"
+checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0"
[[package]]
name = "unicode-segmentation"
-version = "1.11.0"
+version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
+checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
[[package]]
name = "unicode-width"
-version = "0.1.13"
+version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
+checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
[[package]]
name = "unicode-xid"
-version = "0.2.4"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
+checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "unicode_categories"
@@ -13041,9 +13435,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
-version = "2.5.1"
+version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56"
+checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c"
dependencies = [
"form_urlencoded",
"idna",
@@ -13056,12 +13450,6 @@ version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
-[[package]]
-name = "utf16_iter"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246"
-
[[package]]
name = "utf8-ranges"
version = "1.0.5"
@@ -13074,12 +13462,6 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3"
-[[package]]
-name = "utf8_iter"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
-
[[package]]
name = "utf8parse"
version = "0.2.2"
@@ -13088,9 +13470,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "uuid"
-version = "1.8.0"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0"
+checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314"
dependencies = [
"atomic",
"getrandom",
@@ -13101,13 +13483,13 @@ dependencies = [
[[package]]
name = "uuid-macro-internal"
-version = "1.8.0"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9881bea7cbe687e36c9ab3b778c36cd0487402e270304e8b1296d5085303c1a2"
+checksum = "ee1cd046f83ea2c4e920d6ee9f7c3537ef928d75dce5d84a87c2c5d6b3999a3a"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -13138,9 +13520,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]]
name = "vergen"
-version = "8.3.1"
+version = "8.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525"
+checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566"
dependencies = [
"anyhow",
"rustversion",
@@ -13149,9 +13531,9 @@ dependencies = [
[[package]]
name = "version_check"
-version = "0.9.4"
+version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "vob"
@@ -13203,34 +13585,35 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
[[package]]
name = "wasm-bindgen"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
+checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
dependencies = [
"cfg-if",
+ "once_cell",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
+checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.42"
+version = "0.4.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0"
+checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed"
dependencies = [
"cfg-if",
"js-sys",
@@ -13240,9 +13623,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
+checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -13250,28 +13633,28 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
+checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.79",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.92"
+version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
+checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
[[package]]
name = "wasm-streams"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129"
+checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd"
dependencies = [
"futures-util",
"js-sys",
@@ -13282,9 +13665,9 @@ dependencies = [
[[package]]
name = "web-sys"
-version = "0.3.69"
+version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef"
+checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -13354,9 +13737,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1"
[[package]]
name = "webpki-roots"
-version = "0.26.2"
+version = "0.26.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3"
+checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958"
dependencies = [
"rustls-pki-types",
]
@@ -13375,20 +13758,20 @@ dependencies = [
[[package]]
name = "whoami"
-version = "1.5.1"
+version = "1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9"
+checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d"
dependencies = [
- "redox_syscall 0.4.1",
+ "redox_syscall 0.5.7",
"wasite",
"web-sys",
]
[[package]]
name = "wide"
-version = "0.7.24"
+version = "0.7.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a040b111774ab63a19ef46bbc149398ab372b4ccdcfd719e9814dbd7dfd76c8"
+checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690"
dependencies = [
"bytemuck",
"safe_arch",
@@ -13418,11 +13801,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
-version = "0.1.8"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b"
+checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -13451,7 +13834,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
- "windows-targets 0.52.5",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -13460,7 +13843,37 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
- "windows-targets 0.52.5",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-registry"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0"
+dependencies = [
+ "windows-result",
+ "windows-strings",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-result"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e"
+dependencies = [
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-strings"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10"
+dependencies = [
+ "windows-result",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -13487,7 +13900,16 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.5",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets 0.52.6",
]
[[package]]
@@ -13522,18 +13944,18 @@ dependencies = [
[[package]]
name = "windows-targets"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
- "windows_aarch64_gnullvm 0.52.5",
- "windows_aarch64_msvc 0.52.5",
- "windows_i686_gnu 0.52.5",
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
"windows_i686_gnullvm",
- "windows_i686_msvc 0.52.5",
- "windows_x86_64_gnu 0.52.5",
- "windows_x86_64_gnullvm 0.52.5",
- "windows_x86_64_msvc 0.52.5",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
]
[[package]]
@@ -13550,9 +13972,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
@@ -13574,9 +13996,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
@@ -13598,15 +14020,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
@@ -13628,9 +14050,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
@@ -13652,9 +14074,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
@@ -13670,9 +14092,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
@@ -13694,9 +14116,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.52.5"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
@@ -13709,9 +14131,9 @@ dependencies = [
[[package]]
name = "winnow"
-version = "0.6.13"
+version = "0.6.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
+checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b"
dependencies = [
"memchr",
]
@@ -13725,28 +14147,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "winreg"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5"
-dependencies = [
- "cfg-if",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "write16"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
-
-[[package]]
-name = "writeable"
-version = "0.5.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
-
[[package]]
name = "wyz"
version = "0.5.1"
@@ -13767,7 +14167,7 @@ dependencies = [
"chrono",
"der 0.7.9",
"hex",
- "pem",
+ "pem 3.0.4",
"ring 0.17.8",
"signature",
"spki 0.7.3",
@@ -13777,9 +14177,9 @@ dependencies = [
[[package]]
name = "xml-rs"
-version = "0.8.20"
+version = "0.8.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193"
+checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26"
[[package]]
name = "xz2"
@@ -13801,73 +14201,29 @@ dependencies = [
[[package]]
name = "yansi"
-version = "0.5.1"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
-
-[[package]]
-name = "yoke"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5"
-dependencies = [
- "serde",
- "stable_deref_trait",
- "yoke-derive",
- "zerofrom",
-]
-
-[[package]]
-name = "yoke-derive"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.66",
- "synstructure",
-]
+checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
[[package]]
name = "zerocopy"
-version = "0.7.34"
+version = "0.7.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087"
+checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
dependencies = [
+ "byteorder",
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
-version = "0.7.34"
+version = "0.7.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b"
+checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
-]
-
-[[package]]
-name = "zerofrom"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55"
-dependencies = [
- "zerofrom-derive",
-]
-
-[[package]]
-name = "zerofrom-derive"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.66",
- "synstructure",
+ "syn 2.0.79",
]
[[package]]
@@ -13887,29 +14243,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
-]
-
-[[package]]
-name = "zerovec"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079"
-dependencies = [
- "yoke",
- "zerofrom",
- "zerovec-derive",
-]
-
-[[package]]
-name = "zerovec-derive"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.66",
+ "syn 2.0.79",
]
[[package]]
@@ -13932,11 +14266,11 @@ dependencies = [
[[package]]
name = "zstd"
-version = "0.13.1"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a"
+checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9"
dependencies = [
- "zstd-safe 7.1.0",
+ "zstd-safe 7.2.1",
]
[[package]]
@@ -13961,18 +14295,18 @@ dependencies = [
[[package]]
name = "zstd-safe"
-version = "7.1.0"
+version = "7.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a"
+checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059"
dependencies = [
"zstd-sys",
]
[[package]]
name = "zstd-sys"
-version = "2.0.10+zstd.1.5.6"
+version = "2.0.13+zstd.1.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa"
+checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa"
dependencies = [
"cc",
"pkg-config",
diff --git a/Cargo.toml b/Cargo.toml
index d412bf7e97..e45236758f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,6 +20,7 @@ members = [
"src/common/mem-prof",
"src/common/meta",
"src/common/plugins",
+ "src/common/pprof",
"src/common/procedure",
"src/common/procedure-test",
"src/common/query",
@@ -64,7 +65,7 @@ members = [
resolver = "2"
[workspace.package]
-version = "0.9.3"
+version = "0.9.5"
edition = "2021"
license = "Apache-2.0"
@@ -90,7 +91,7 @@ aquamarine = "0.3"
arrow = { version = "51.0.0", features = ["prettyprint"] }
arrow-array = { version = "51.0.0", default-features = false, features = ["chrono-tz"] }
arrow-flight = "51.0"
-arrow-ipc = { version = "51.0.0", default-features = false, features = ["lz4"] }
+arrow-ipc = { version = "51.0.0", default-features = false, features = ["lz4", "zstd"] }
arrow-schema = { version = "51.0", features = ["serde"] }
async-stream = "0.3"
async-trait = "0.1"
@@ -99,7 +100,7 @@ base64 = "0.21"
bigdecimal = "0.4.2"
bitflags = "2.4.1"
bytemuck = "1.12"
-bytes = { version = "1.5", features = ["serde"] }
+bytes = { version = "1.7", features = ["serde"] }
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4.4", features = ["derive"] }
config = "0.13.0"
@@ -120,13 +121,13 @@ etcd-client = { version = "0.13" }
fst = "0.4.7"
futures = "0.3"
futures-util = "0.3"
-greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "973f49cde88a582fb65755cc572ebcf6fb93ccf7" }
+greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "255f87a3318ace3f88a67f76995a0e14910983f4" }
humantime = "2.1"
humantime-serde = "1.1"
itertools = "0.10"
-jsonb = { git = "https://github.com/CookiePieWw/jsonb.git", rev = "d0166c130fce903bf6c58643417a3173a6172d31", default-features = false }
+jsonb = { git = "https://github.com/databendlabs/jsonb.git", rev = "46ad50fc71cf75afbf98eec455f7892a6387c1fc", default-features = false }
lazy_static = "1.4"
-meter-core = { git = "https://github.com/GreptimeTeam/greptime-meter.git", rev = "80eb97c24c88af4dd9a86f8bbaf50e741d4eb8cd" }
+meter-core = { git = "https://github.com/GreptimeTeam/greptime-meter.git", rev = "a10facb353b41460eeb98578868ebf19c2084fac" }
mockall = "0.11.4"
moka = "0.12"
notify = "6.1"
@@ -136,15 +137,19 @@ opentelemetry-proto = { version = "0.5", features = [
"gen-tonic",
"metrics",
"trace",
+ "with-serde",
+ "logs",
] }
+parking_lot = "0.12"
parquet = { version = "51.0.0", default-features = false, features = ["arrow", "async", "object_store"] }
paste = "1.0"
pin-project = "1.0"
prometheus = { version = "0.13.3", features = ["process"] }
-promql-parser = { version = "0.4" }
+promql-parser = { version = "0.4.3", features = ["ser"] }
prost = "0.12"
raft-engine = { version = "0.4.1", default-features = false }
rand = "0.8"
+ratelimit = "0.9"
regex = "1.8"
regex-automata = { version = "0.4" }
reqwest = { version = "0.12", default-features = false, features = [
@@ -164,7 +169,8 @@ schemars = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["float_roundtrip"] }
serde_with = "3"
-shadow-rs = "0.31"
+shadow-rs = "0.35"
+similar-asserts = "1.6.0"
smallvec = { version = "1", features = ["serde"] }
snafu = "0.8"
sysinfo = "0.30"
@@ -174,13 +180,16 @@ sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "5
] }
strum = { version = "0.25", features = ["derive"] }
tempfile = "3"
-tokio = { version = "1.36", features = ["full"] }
+tokio = { version = "1.40", features = ["full"] }
tokio-postgres = "0.7"
tokio-stream = { version = "0.1" }
tokio-util = { version = "0.7", features = ["io-util", "compat"] }
toml = "0.8.8"
tonic = { version = "0.11", features = ["tls", "gzip", "zstd"] }
tower = { version = "0.4" }
+tracing-appender = "0.2"
+tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "fmt"] }
+typetag = "0.2"
uuid = { version = "1.7", features = ["serde", "v4", "fast-rng"] }
zstd = "0.13"
@@ -206,6 +215,7 @@ common-macro = { path = "src/common/macro" }
common-mem-prof = { path = "src/common/mem-prof" }
common-meta = { path = "src/common/meta" }
common-plugins = { path = "src/common/plugins" }
+common-pprof = { path = "src/common/pprof" }
common-procedure = { path = "src/common/procedure" }
common-procedure-test = { path = "src/common/procedure-test" }
common-query = { path = "src/common/query" }
@@ -243,9 +253,18 @@ store-api = { path = "src/store-api" }
substrait = { path = "src/common/substrait" }
table = { path = "src/table" }
+[patch.crates-io]
+# change all rustls dependencies to use our fork to default to `ring` to make it "just work"
+hyper-rustls = { git = "https://github.com/GreptimeTeam/hyper-rustls" }
+rustls = { git = "https://github.com/GreptimeTeam/rustls" }
+tokio-rustls = { git = "https://github.com/GreptimeTeam/tokio-rustls" }
+# This is commented, since we are not using aws-lc-sys, if we need to use it, we need to uncomment this line or use a release after this commit, or it wouldn't compile with gcc < 8.1
+# see https://github.com/aws/aws-lc-rs/pull/526
+# aws-lc-sys = { git ="https://github.com/aws/aws-lc-rs", rev = "556558441e3494af4b156ae95ebc07ebc2fd38aa" }
+
[workspace.dependencies.meter-macros]
git = "https://github.com/GreptimeTeam/greptime-meter.git"
-rev = "80eb97c24c88af4dd9a86f8bbaf50e741d4eb8cd"
+rev = "a10facb353b41460eeb98578868ebf19c2084fac"
[profile.release]
debug = 1
diff --git a/Makefile b/Makefile
index acc2a73126..dd335c370a 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ CARGO_BUILD_OPTS := --locked
IMAGE_REGISTRY ?= docker.io
IMAGE_NAMESPACE ?= greptime
IMAGE_TAG ?= latest
-DEV_BUILDER_IMAGE_TAG ?= 2024-06-06-b4b105ad-20240827021230
+DEV_BUILDER_IMAGE_TAG ?= 2024-10-19-a5c00e85-20241024184445
BUILDX_MULTI_PLATFORM_BUILD ?= false
BUILDX_BUILDER_NAME ?= gtbuilder
BASE_IMAGE ?= ubuntu
@@ -221,7 +221,7 @@ config-docs: ## Generate configuration documentation from toml files.
docker run --rm \
-v ${PWD}:/greptimedb \
-w /greptimedb/config \
- toml2docs/toml2docs:v0.1.1 \
+ toml2docs/toml2docs:v0.1.3 \
-p '##' \
-t ./config-docs-template.md \
-o ./config.md
diff --git a/config/config.md b/config/config.md
index a792be5de5..65d8fa0c16 100644
--- a/config/config.md
+++ b/config/config.md
@@ -14,9 +14,10 @@
| --- | -----| ------- | ----------- |
| `mode` | String | `standalone` | The running mode of the datanode. It can be `standalone` or `distributed`. |
| `enable_telemetry` | Bool | `true` | Enable telemetry to collect anonymous usage data. |
-| `default_timezone` | String | `None` | The default timezone of the server. |
+| `default_timezone` | String | Unset | The default timezone of the server. |
| `init_regions_in_background` | Bool | `false` | Initialize all regions in the background during the startup. By default, it provides services after all regions have been initialized. |
| `init_regions_parallelism` | Integer | `16` | Parallelism of initializing regions. |
+| `max_concurrent_queries` | Integer | `0` | The maximum current queries allowed to be executed. Zero means unlimited. |
| `runtime` | -- | -- | The runtime options. |
| `runtime.global_rt_size` | Integer | `8` | The number of threads to execute the runtime for global read operations. |
| `runtime.compact_rt_size` | Integer | `4` | The number of threads to execute the runtime for global write operations. |
@@ -29,8 +30,8 @@
| `grpc.runtime_size` | Integer | `8` | The number of server worker threads. |
| `grpc.tls` | -- | -- | gRPC server TLS options, see `mysql.tls` section. |
| `grpc.tls.mode` | String | `disable` | TLS mode. |
-| `grpc.tls.cert_path` | String | `None` | Certificate file path. |
-| `grpc.tls.key_path` | String | `None` | Private key file path. |
+| `grpc.tls.cert_path` | String | Unset | Certificate file path. |
+| `grpc.tls.key_path` | String | Unset | Private key file path. |
| `grpc.tls.watch` | Bool | `false` | Watch for Certificate and key file change and auto reload. For now, gRPC tls config does not support auto reload. |
| `mysql` | -- | -- | MySQL server options. |
| `mysql.enable` | Bool | `true` | Whether to enable. |
@@ -38,8 +39,8 @@
| `mysql.runtime_size` | Integer | `2` | The number of server worker threads. |
| `mysql.tls` | -- | -- | -- |
| `mysql.tls.mode` | String | `disable` | TLS mode, refer to https://www.postgresql.org/docs/current/libpq-ssl.html - `disable` (default value) - `prefer` - `require` - `verify-ca` - `verify-full` |
-| `mysql.tls.cert_path` | String | `None` | Certificate file path. |
-| `mysql.tls.key_path` | String | `None` | Private key file path. |
+| `mysql.tls.cert_path` | String | Unset | Certificate file path. |
+| `mysql.tls.key_path` | String | Unset | Private key file path. |
| `mysql.tls.watch` | Bool | `false` | Watch for Certificate and key file change and auto reload |
| `postgres` | -- | -- | PostgresSQL server options. |
| `postgres.enable` | Bool | `true` | Whether to enable |
@@ -47,8 +48,8 @@
| `postgres.runtime_size` | Integer | `2` | The number of server worker threads. |
| `postgres.tls` | -- | -- | PostgresSQL server TLS options, see `mysql.tls` section. |
| `postgres.tls.mode` | String | `disable` | TLS mode. |
-| `postgres.tls.cert_path` | String | `None` | Certificate file path. |
-| `postgres.tls.key_path` | String | `None` | Private key file path. |
+| `postgres.tls.cert_path` | String | Unset | Certificate file path. |
+| `postgres.tls.key_path` | String | Unset | Private key file path. |
| `postgres.tls.watch` | Bool | `false` | Watch for Certificate and key file change and auto reload |
| `opentsdb` | -- | -- | OpenTSDB protocol options. |
| `opentsdb.enable` | Bool | `true` | Whether to enable OpenTSDB put in HTTP API. |
@@ -59,7 +60,7 @@
| `prom_store.with_metric_engine` | Bool | `true` | Whether to store the data from Prometheus remote write in metric engine. |
| `wal` | -- | -- | The WAL options. |
| `wal.provider` | String | `raft_engine` | The provider of the WAL. - `raft_engine`: the wal is stored in the local file system by raft-engine. - `kafka`: it's remote wal that data is stored in Kafka. |
-| `wal.dir` | String | `None` | The directory to store the WAL files. **It's only used when the provider is `raft_engine`**. |
+| `wal.dir` | String | Unset | The directory to store the WAL files. **It's only used when the provider is `raft_engine`**. |
| `wal.file_size` | String | `256MB` | The size of the WAL segment file. **It's only used when the provider is `raft_engine`**. |
| `wal.purge_threshold` | String | `4GB` | The threshold of the WAL size to trigger a flush. **It's only used when the provider is `raft_engine`**. |
| `wal.purge_interval` | String | `10m` | The interval to trigger a flush. **It's only used when the provider is `raft_engine`**. |
@@ -82,6 +83,7 @@
| `wal.backoff_max` | String | `10s` | The maximum backoff delay. **It's only used when the provider is `kafka`**. |
| `wal.backoff_base` | Integer | `2` | The exponential backoff rate, i.e. next backoff = base * current backoff. **It's only used when the provider is `kafka`**. |
| `wal.backoff_deadline` | String | `5mins` | The deadline of retries. **It's only used when the provider is `kafka`**. |
+| `wal.overwrite_entry_start_id` | Bool | `false` | Ignore missing entries during read WAL. **It's only used when the provider is `kafka`**. This option ensures that when Kafka messages are deleted, the system can still successfully replay memtable data without throwing an out-of-range error. However, enabling this option might lead to unexpected data loss, as the system will skip over missing entries instead of treating them as critical errors. |
| `metadata_store` | -- | -- | Metadata storage options. |
| `metadata_store.file_size` | String | `256MB` | Kv file size in bytes. |
| `metadata_store.purge_threshold` | String | `4GB` | Kv purge threshold. |
@@ -91,22 +93,22 @@
| `storage` | -- | -- | The data storage options. |
| `storage.data_home` | String | `/tmp/greptimedb/` | The working home directory. |
| `storage.type` | String | `File` | The storage type used to store the data. - `File`: the data is stored in the local file system. - `S3`: the data is stored in the S3 object storage. - `Gcs`: the data is stored in the Google Cloud Storage. - `Azblob`: the data is stored in the Azure Blob Storage. - `Oss`: the data is stored in the Aliyun OSS. |
-| `storage.cache_path` | String | `None` | Cache configuration for object storage such as 'S3' etc. The local file cache directory. |
-| `storage.cache_capacity` | String | `None` | The local file cache capacity in bytes. |
-| `storage.bucket` | String | `None` | The S3 bucket name. **It's only used when the storage type is `S3`, `Oss` and `Gcs`**. |
-| `storage.root` | String | `None` | The S3 data will be stored in the specified prefix, for example, `s3://${bucket}/${root}`. **It's only used when the storage type is `S3`, `Oss` and `Azblob`**. |
-| `storage.access_key_id` | String | `None` | The access key id of the aws account. It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key. **It's only used when the storage type is `S3` and `Oss`**. |
-| `storage.secret_access_key` | String | `None` | The secret access key of the aws account. It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key. **It's only used when the storage type is `S3`**. |
-| `storage.access_key_secret` | String | `None` | The secret access key of the aliyun account. **It's only used when the storage type is `Oss`**. |
-| `storage.account_name` | String | `None` | The account key of the azure account. **It's only used when the storage type is `Azblob`**. |
-| `storage.account_key` | String | `None` | The account key of the azure account. **It's only used when the storage type is `Azblob`**. |
-| `storage.scope` | String | `None` | The scope of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
-| `storage.credential_path` | String | `None` | The credential path of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
-| `storage.credential` | String | `None` | The credential of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
-| `storage.container` | String | `None` | The container of the azure account. **It's only used when the storage type is `Azblob`**. |
-| `storage.sas_token` | String | `None` | The sas token of the azure account. **It's only used when the storage type is `Azblob`**. |
-| `storage.endpoint` | String | `None` | The endpoint of the S3 service. **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**. |
-| `storage.region` | String | `None` | The region of the S3 service. **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**. |
+| `storage.cache_path` | String | Unset | Cache configuration for object storage such as 'S3' etc. The local file cache directory. |
+| `storage.cache_capacity` | String | Unset | The local file cache capacity in bytes. |
+| `storage.bucket` | String | Unset | The S3 bucket name. **It's only used when the storage type is `S3`, `Oss` and `Gcs`**. |
+| `storage.root` | String | Unset | The S3 data will be stored in the specified prefix, for example, `s3://${bucket}/${root}`. **It's only used when the storage type is `S3`, `Oss` and `Azblob`**. |
+| `storage.access_key_id` | String | Unset | The access key id of the aws account. It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key. **It's only used when the storage type is `S3` and `Oss`**. |
+| `storage.secret_access_key` | String | Unset | The secret access key of the aws account. It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key. **It's only used when the storage type is `S3`**. |
+| `storage.access_key_secret` | String | Unset | The secret access key of the aliyun account. **It's only used when the storage type is `Oss`**. |
+| `storage.account_name` | String | Unset | The account key of the azure account. **It's only used when the storage type is `Azblob`**. |
+| `storage.account_key` | String | Unset | The account key of the azure account. **It's only used when the storage type is `Azblob`**. |
+| `storage.scope` | String | Unset | The scope of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
+| `storage.credential_path` | String | Unset | The credential path of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
+| `storage.credential` | String | Unset | The credential of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
+| `storage.container` | String | Unset | The container of the azure account. **It's only used when the storage type is `Azblob`**. |
+| `storage.sas_token` | String | Unset | The sas token of the azure account. **It's only used when the storage type is `Azblob`**. |
+| `storage.endpoint` | String | Unset | The endpoint of the S3 service. **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**. |
+| `storage.region` | String | Unset | The region of the S3 service. **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**. |
| `[[region_engine]]` | -- | -- | The region engine options. You can configure multiple region engines. |
| `region_engine.mito` | -- | -- | The Mito engine options. |
| `region_engine.mito.num_workers` | Integer | `8` | Number of region workers. |
@@ -114,18 +116,20 @@
| `region_engine.mito.worker_request_batch_size` | Integer | `64` | Max batch size for a worker to handle requests. |
| `region_engine.mito.manifest_checkpoint_distance` | Integer | `10` | Number of meta action updated to trigger a new checkpoint for the manifest. |
| `region_engine.mito.compress_manifest` | Bool | `false` | Whether to compress manifest and checkpoint file by gzip (default false). |
-| `region_engine.mito.max_background_jobs` | Integer | `4` | Max number of running background jobs |
+| `region_engine.mito.max_background_flushes` | Integer | Auto | Max number of running background flush jobs (default: 1/2 of cpu cores). |
+| `region_engine.mito.max_background_compactions` | Integer | Auto | Max number of running background compaction jobs (default: 1/4 of cpu cores). |
+| `region_engine.mito.max_background_purges` | Integer | Auto | Max number of running background purge jobs (default: number of cpu cores). |
| `region_engine.mito.auto_flush_interval` | String | `1h` | Interval to auto flush a region if it has not flushed yet. |
-| `region_engine.mito.global_write_buffer_size` | String | `1GB` | Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. |
-| `region_engine.mito.global_write_buffer_reject_size` | String | `2GB` | Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size` |
-| `region_engine.mito.sst_meta_cache_size` | String | `128MB` | Cache size for SST metadata. Setting it to 0 to disable the cache. If not set, it's default to 1/32 of OS memory with a max limitation of 128MB. |
-| `region_engine.mito.vector_cache_size` | String | `512MB` | Cache size for vectors and arrow arrays. Setting it to 0 to disable the cache. If not set, it's default to 1/16 of OS memory with a max limitation of 512MB. |
-| `region_engine.mito.page_cache_size` | String | `512MB` | Cache size for pages of SST row groups. Setting it to 0 to disable the cache. If not set, it's default to 1/8 of OS memory. |
-| `region_engine.mito.selector_result_cache_size` | String | `512MB` | Cache size for time series selector (e.g. `last_value()`). Setting it to 0 to disable the cache. If not set, it's default to 1/16 of OS memory with a max limitation of 512MB. |
+| `region_engine.mito.global_write_buffer_size` | String | Auto | Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. |
+| `region_engine.mito.global_write_buffer_reject_size` | String | Auto | Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size`. |
+| `region_engine.mito.sst_meta_cache_size` | String | Auto | Cache size for SST metadata. Setting it to 0 to disable the cache. If not set, it's default to 1/32 of OS memory with a max limitation of 128MB. |
+| `region_engine.mito.vector_cache_size` | String | Auto | Cache size for vectors and arrow arrays. Setting it to 0 to disable the cache. If not set, it's default to 1/16 of OS memory with a max limitation of 512MB. |
+| `region_engine.mito.page_cache_size` | String | Auto | Cache size for pages of SST row groups. Setting it to 0 to disable the cache. If not set, it's default to 1/8 of OS memory. |
+| `region_engine.mito.selector_result_cache_size` | String | Auto | Cache size for time series selector (e.g. `last_value()`). Setting it to 0 to disable the cache. If not set, it's default to 1/16 of OS memory with a max limitation of 512MB. |
| `region_engine.mito.enable_experimental_write_cache` | Bool | `false` | Whether to enable the experimental write cache. |
| `region_engine.mito.experimental_write_cache_path` | String | `""` | File system path for write cache, defaults to `{data_home}/write_cache`. |
| `region_engine.mito.experimental_write_cache_size` | String | `512MB` | Capacity for write cache. |
-| `region_engine.mito.experimental_write_cache_ttl` | String | `None` | TTL for write cache. |
+| `region_engine.mito.experimental_write_cache_ttl` | String | Unset | TTL for write cache. |
| `region_engine.mito.sst_write_buffer_size` | String | `8MB` | Buffer size for SST writing. |
| `region_engine.mito.scan_parallelism` | Integer | `0` | Parallelism to scan a region (default: 1/4 of cpu cores). - `0`: using the default value (1/4 of cpu cores). - `1`: scan in current thread. - `n`: scan in parallelism n. |
| `region_engine.mito.parallel_scan_channel_size` | Integer | `32` | Capacity of the channel to send data from parallel scan tasks to the main task. |
@@ -155,23 +159,28 @@
| `region_engine.file` | -- | -- | Enable the file engine. |
| `logging` | -- | -- | The logging options. |
| `logging.dir` | String | `/tmp/greptimedb/logs` | The directory to store the log files. If set to empty, logs will not be written to files. |
-| `logging.level` | String | `None` | The log level. Can be `info`/`debug`/`warn`/`error`. |
+| `logging.level` | String | Unset | The log level. Can be `info`/`debug`/`warn`/`error`. |
| `logging.enable_otlp_tracing` | Bool | `false` | Enable OTLP tracing. |
| `logging.otlp_endpoint` | String | `http://localhost:4317` | The OTLP tracing endpoint. |
| `logging.append_stdout` | Bool | `true` | Whether to append logs to stdout. |
| `logging.log_format` | String | `text` | The log format. Can be `text`/`json`. |
+| `logging.max_log_files` | Integer | `720` | The maximum amount of log files. |
| `logging.tracing_sample_ratio` | -- | -- | The percentage of tracing will be sampled and exported. Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1. ratio > 1 are treated as 1. Fractions < 0 are treated as 0 |
| `logging.tracing_sample_ratio.default_ratio` | Float | `1.0` | -- |
+| `logging.slow_query` | -- | -- | The slow query log options. |
+| `logging.slow_query.enable` | Bool | `false` | Whether to enable slow query log. |
+| `logging.slow_query.threshold` | String | Unset | The threshold of slow query. |
+| `logging.slow_query.sample_ratio` | Float | Unset | The sampling ratio of slow query log. The value should be in the range of (0, 1]. |
| `export_metrics` | -- | -- | The datanode can export its metrics and send to Prometheus compatible service (e.g. send to `greptimedb` itself) from remote-write API. This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape. |
| `export_metrics.enable` | Bool | `false` | whether enable export metrics. |
| `export_metrics.write_interval` | String | `30s` | The interval of export metrics. |
-| `export_metrics.self_import` | -- | -- | For `standalone` mode, `self_import` is recommend to collect metrics generated by itself You must create the database before enabling it. |
-| `export_metrics.self_import.db` | String | `None` | -- |
+| `export_metrics.self_import` | -- | -- | For `standalone` mode, `self_import` is recommended to collect metrics generated by itself You must create the database before enabling it. |
+| `export_metrics.self_import.db` | String | Unset | -- |
| `export_metrics.remote_write` | -- | -- | -- |
| `export_metrics.remote_write.url` | String | `""` | The url the metrics send to. The url example can be: `http://127.0.0.1:4000/v1/prometheus/write?db=greptime_metrics`. |
| `export_metrics.remote_write.headers` | InlineTable | -- | HTTP headers of Prometheus remote-write carry. |
| `tracing` | -- | -- | The tracing options. Only effect when compiled with `tokio-console` feature. |
-| `tracing.tokio_console_addr` | String | `None` | The tokio console address. |
+| `tracing.tokio_console_addr` | String | Unset | The tokio console address. |
## Distributed Mode
@@ -180,7 +189,7 @@
| Key | Type | Default | Descriptions |
| --- | -----| ------- | ----------- |
-| `default_timezone` | String | `None` | The default timezone of the server. |
+| `default_timezone` | String | Unset | The default timezone of the server. |
| `runtime` | -- | -- | The runtime options. |
| `runtime.global_rt_size` | Integer | `8` | The number of threads to execute the runtime for global read operations. |
| `runtime.compact_rt_size` | Integer | `4` | The number of threads to execute the runtime for global write operations. |
@@ -197,8 +206,8 @@
| `grpc.runtime_size` | Integer | `8` | The number of server worker threads. |
| `grpc.tls` | -- | -- | gRPC server TLS options, see `mysql.tls` section. |
| `grpc.tls.mode` | String | `disable` | TLS mode. |
-| `grpc.tls.cert_path` | String | `None` | Certificate file path. |
-| `grpc.tls.key_path` | String | `None` | Private key file path. |
+| `grpc.tls.cert_path` | String | Unset | Certificate file path. |
+| `grpc.tls.key_path` | String | Unset | Private key file path. |
| `grpc.tls.watch` | Bool | `false` | Watch for Certificate and key file change and auto reload. For now, gRPC tls config does not support auto reload. |
| `mysql` | -- | -- | MySQL server options. |
| `mysql.enable` | Bool | `true` | Whether to enable. |
@@ -206,8 +215,8 @@
| `mysql.runtime_size` | Integer | `2` | The number of server worker threads. |
| `mysql.tls` | -- | -- | -- |
| `mysql.tls.mode` | String | `disable` | TLS mode, refer to https://www.postgresql.org/docs/current/libpq-ssl.html - `disable` (default value) - `prefer` - `require` - `verify-ca` - `verify-full` |
-| `mysql.tls.cert_path` | String | `None` | Certificate file path. |
-| `mysql.tls.key_path` | String | `None` | Private key file path. |
+| `mysql.tls.cert_path` | String | Unset | Certificate file path. |
+| `mysql.tls.key_path` | String | Unset | Private key file path. |
| `mysql.tls.watch` | Bool | `false` | Watch for Certificate and key file change and auto reload |
| `postgres` | -- | -- | PostgresSQL server options. |
| `postgres.enable` | Bool | `true` | Whether to enable |
@@ -215,8 +224,8 @@
| `postgres.runtime_size` | Integer | `2` | The number of server worker threads. |
| `postgres.tls` | -- | -- | PostgresSQL server TLS options, see `mysql.tls` section. |
| `postgres.tls.mode` | String | `disable` | TLS mode. |
-| `postgres.tls.cert_path` | String | `None` | Certificate file path. |
-| `postgres.tls.key_path` | String | `None` | Private key file path. |
+| `postgres.tls.cert_path` | String | Unset | Certificate file path. |
+| `postgres.tls.key_path` | String | Unset | Private key file path. |
| `postgres.tls.watch` | Bool | `false` | Watch for Certificate and key file change and auto reload |
| `opentsdb` | -- | -- | OpenTSDB protocol options. |
| `opentsdb.enable` | Bool | `true` | Whether to enable OpenTSDB put in HTTP API. |
@@ -241,23 +250,28 @@
| `datanode.client.tcp_nodelay` | Bool | `true` | -- |
| `logging` | -- | -- | The logging options. |
| `logging.dir` | String | `/tmp/greptimedb/logs` | The directory to store the log files. If set to empty, logs will not be written to files. |
-| `logging.level` | String | `None` | The log level. Can be `info`/`debug`/`warn`/`error`. |
+| `logging.level` | String | Unset | The log level. Can be `info`/`debug`/`warn`/`error`. |
| `logging.enable_otlp_tracing` | Bool | `false` | Enable OTLP tracing. |
| `logging.otlp_endpoint` | String | `http://localhost:4317` | The OTLP tracing endpoint. |
| `logging.append_stdout` | Bool | `true` | Whether to append logs to stdout. |
| `logging.log_format` | String | `text` | The log format. Can be `text`/`json`. |
+| `logging.max_log_files` | Integer | `720` | The maximum amount of log files. |
| `logging.tracing_sample_ratio` | -- | -- | The percentage of tracing will be sampled and exported. Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1. ratio > 1 are treated as 1. Fractions < 0 are treated as 0 |
| `logging.tracing_sample_ratio.default_ratio` | Float | `1.0` | -- |
+| `logging.slow_query` | -- | -- | The slow query log options. |
+| `logging.slow_query.enable` | Bool | `false` | Whether to enable slow query log. |
+| `logging.slow_query.threshold` | String | Unset | The threshold of slow query. |
+| `logging.slow_query.sample_ratio` | Float | Unset | The sampling ratio of slow query log. The value should be in the range of (0, 1]. |
| `export_metrics` | -- | -- | The datanode can export its metrics and send to Prometheus compatible service (e.g. send to `greptimedb` itself) from remote-write API. This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape. |
| `export_metrics.enable` | Bool | `false` | whether enable export metrics. |
| `export_metrics.write_interval` | String | `30s` | The interval of export metrics. |
| `export_metrics.self_import` | -- | -- | For `standalone` mode, `self_import` is recommend to collect metrics generated by itself You must create the database before enabling it. |
-| `export_metrics.self_import.db` | String | `None` | -- |
+| `export_metrics.self_import.db` | String | Unset | -- |
| `export_metrics.remote_write` | -- | -- | -- |
| `export_metrics.remote_write.url` | String | `""` | The url the metrics send to. The url example can be: `http://127.0.0.1:4000/v1/prometheus/write?db=greptime_metrics`. |
| `export_metrics.remote_write.headers` | InlineTable | -- | HTTP headers of Prometheus remote-write carry. |
| `tracing` | -- | -- | The tracing options. Only effect when compiled with `tokio-console` feature. |
-| `tracing.tokio_console_addr` | String | `None` | The tokio console address. |
+| `tracing.tokio_console_addr` | String | Unset | The tokio console address. |
### Metasrv
@@ -306,23 +320,28 @@
| `wal.backoff_deadline` | String | `5mins` | Stop reconnecting if the total wait time reaches the deadline. If this config is missing, the reconnecting won't terminate. |
| `logging` | -- | -- | The logging options. |
| `logging.dir` | String | `/tmp/greptimedb/logs` | The directory to store the log files. If set to empty, logs will not be written to files. |
-| `logging.level` | String | `None` | The log level. Can be `info`/`debug`/`warn`/`error`. |
+| `logging.level` | String | Unset | The log level. Can be `info`/`debug`/`warn`/`error`. |
| `logging.enable_otlp_tracing` | Bool | `false` | Enable OTLP tracing. |
| `logging.otlp_endpoint` | String | `http://localhost:4317` | The OTLP tracing endpoint. |
| `logging.append_stdout` | Bool | `true` | Whether to append logs to stdout. |
| `logging.log_format` | String | `text` | The log format. Can be `text`/`json`. |
+| `logging.max_log_files` | Integer | `720` | The maximum amount of log files. |
| `logging.tracing_sample_ratio` | -- | -- | The percentage of tracing will be sampled and exported. Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1. ratio > 1 are treated as 1. Fractions < 0 are treated as 0 |
| `logging.tracing_sample_ratio.default_ratio` | Float | `1.0` | -- |
+| `logging.slow_query` | -- | -- | The slow query log options. |
+| `logging.slow_query.enable` | Bool | `false` | Whether to enable slow query log. |
+| `logging.slow_query.threshold` | String | Unset | The threshold of slow query. |
+| `logging.slow_query.sample_ratio` | Float | Unset | The sampling ratio of slow query log. The value should be in the range of (0, 1]. |
| `export_metrics` | -- | -- | The datanode can export its metrics and send to Prometheus compatible service (e.g. send to `greptimedb` itself) from remote-write API. This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape. |
| `export_metrics.enable` | Bool | `false` | whether enable export metrics. |
| `export_metrics.write_interval` | String | `30s` | The interval of export metrics. |
| `export_metrics.self_import` | -- | -- | For `standalone` mode, `self_import` is recommend to collect metrics generated by itself You must create the database before enabling it. |
-| `export_metrics.self_import.db` | String | `None` | -- |
+| `export_metrics.self_import.db` | String | Unset | -- |
| `export_metrics.remote_write` | -- | -- | -- |
| `export_metrics.remote_write.url` | String | `""` | The url the metrics send to. The url example can be: `http://127.0.0.1:4000/v1/prometheus/write?db=greptime_metrics`. |
| `export_metrics.remote_write.headers` | InlineTable | -- | HTTP headers of Prometheus remote-write carry. |
| `tracing` | -- | -- | The tracing options. Only effect when compiled with `tokio-console` feature. |
-| `tracing.tokio_console_addr` | String | `None` | The tokio console address. |
+| `tracing.tokio_console_addr` | String | Unset | The tokio console address. |
### Datanode
@@ -330,16 +349,17 @@
| Key | Type | Default | Descriptions |
| --- | -----| ------- | ----------- |
| `mode` | String | `standalone` | The running mode of the datanode. It can be `standalone` or `distributed`. |
-| `node_id` | Integer | `None` | The datanode identifier and should be unique in the cluster. |
+| `node_id` | Integer | Unset | The datanode identifier and should be unique in the cluster. |
| `require_lease_before_startup` | Bool | `false` | Start services after regions have obtained leases. It will block the datanode start if it can't receive leases in the heartbeat from metasrv. |
| `init_regions_in_background` | Bool | `false` | Initialize all regions in the background during the startup. By default, it provides services after all regions have been initialized. |
| `enable_telemetry` | Bool | `true` | Enable telemetry to collect anonymous usage data. |
| `init_regions_parallelism` | Integer | `16` | Parallelism of initializing regions. |
-| `rpc_addr` | String | `None` | Deprecated, use `grpc.addr` instead. |
-| `rpc_hostname` | String | `None` | Deprecated, use `grpc.hostname` instead. |
-| `rpc_runtime_size` | Integer | `None` | Deprecated, use `grpc.runtime_size` instead. |
-| `rpc_max_recv_message_size` | String | `None` | Deprecated, use `grpc.rpc_max_recv_message_size` instead. |
-| `rpc_max_send_message_size` | String | `None` | Deprecated, use `grpc.rpc_max_send_message_size` instead. |
+| `max_concurrent_queries` | Integer | `0` | The maximum current queries allowed to be executed. Zero means unlimited. |
+| `rpc_addr` | String | Unset | Deprecated, use `grpc.addr` instead. |
+| `rpc_hostname` | String | Unset | Deprecated, use `grpc.hostname` instead. |
+| `rpc_runtime_size` | Integer | Unset | Deprecated, use `grpc.runtime_size` instead. |
+| `rpc_max_recv_message_size` | String | Unset | Deprecated, use `grpc.rpc_max_recv_message_size` instead. |
+| `rpc_max_send_message_size` | String | Unset | Deprecated, use `grpc.rpc_max_send_message_size` instead. |
| `http` | -- | -- | The HTTP server options. |
| `http.addr` | String | `127.0.0.1:4000` | The address to bind the HTTP server. |
| `http.timeout` | String | `30s` | HTTP request timeout. Set to 0 to disable timeout. |
@@ -352,8 +372,8 @@
| `grpc.max_send_message_size` | String | `512MB` | The maximum send message size for gRPC server. |
| `grpc.tls` | -- | -- | gRPC server TLS options, see `mysql.tls` section. |
| `grpc.tls.mode` | String | `disable` | TLS mode. |
-| `grpc.tls.cert_path` | String | `None` | Certificate file path. |
-| `grpc.tls.key_path` | String | `None` | Private key file path. |
+| `grpc.tls.cert_path` | String | Unset | Certificate file path. |
+| `grpc.tls.key_path` | String | Unset | Private key file path. |
| `grpc.tls.watch` | Bool | `false` | Watch for Certificate and key file change and auto reload. For now, gRPC tls config does not support auto reload. |
| `runtime` | -- | -- | The runtime options. |
| `runtime.global_rt_size` | Integer | `8` | The number of threads to execute the runtime for global read operations. |
@@ -373,7 +393,7 @@
| `meta_client.metadata_cache_tti` | String | `5m` | -- |
| `wal` | -- | -- | The WAL options. |
| `wal.provider` | String | `raft_engine` | The provider of the WAL. - `raft_engine`: the wal is stored in the local file system by raft-engine. - `kafka`: it's remote wal that data is stored in Kafka. |
-| `wal.dir` | String | `None` | The directory to store the WAL files. **It's only used when the provider is `raft_engine`**. |
+| `wal.dir` | String | Unset | The directory to store the WAL files. **It's only used when the provider is `raft_engine`**. |
| `wal.file_size` | String | `256MB` | The size of the WAL segment file. **It's only used when the provider is `raft_engine`**. |
| `wal.purge_threshold` | String | `4GB` | The threshold of the WAL size to trigger a flush. **It's only used when the provider is `raft_engine`**. |
| `wal.purge_interval` | String | `10m` | The interval to trigger a flush. **It's only used when the provider is `raft_engine`**. |
@@ -392,25 +412,26 @@
| `wal.backoff_deadline` | String | `5mins` | The deadline of retries. **It's only used when the provider is `kafka`**. |
| `wal.create_index` | Bool | `true` | Whether to enable WAL index creation. **It's only used when the provider is `kafka`**. |
| `wal.dump_index_interval` | String | `60s` | The interval for dumping WAL indexes. **It's only used when the provider is `kafka`**. |
+| `wal.overwrite_entry_start_id` | Bool | `false` | Ignore missing entries during read WAL. **It's only used when the provider is `kafka`**. This option ensures that when Kafka messages are deleted, the system can still successfully replay memtable data without throwing an out-of-range error. However, enabling this option might lead to unexpected data loss, as the system will skip over missing entries instead of treating them as critical errors. |
| `storage` | -- | -- | The data storage options. |
| `storage.data_home` | String | `/tmp/greptimedb/` | The working home directory. |
| `storage.type` | String | `File` | The storage type used to store the data. - `File`: the data is stored in the local file system. - `S3`: the data is stored in the S3 object storage. - `Gcs`: the data is stored in the Google Cloud Storage. - `Azblob`: the data is stored in the Azure Blob Storage. - `Oss`: the data is stored in the Aliyun OSS. |
-| `storage.cache_path` | String | `None` | Cache configuration for object storage such as 'S3' etc. The local file cache directory. |
-| `storage.cache_capacity` | String | `None` | The local file cache capacity in bytes. |
-| `storage.bucket` | String | `None` | The S3 bucket name. **It's only used when the storage type is `S3`, `Oss` and `Gcs`**. |
-| `storage.root` | String | `None` | The S3 data will be stored in the specified prefix, for example, `s3://${bucket}/${root}`. **It's only used when the storage type is `S3`, `Oss` and `Azblob`**. |
-| `storage.access_key_id` | String | `None` | The access key id of the aws account. It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key. **It's only used when the storage type is `S3` and `Oss`**. |
-| `storage.secret_access_key` | String | `None` | The secret access key of the aws account. It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key. **It's only used when the storage type is `S3`**. |
-| `storage.access_key_secret` | String | `None` | The secret access key of the aliyun account. **It's only used when the storage type is `Oss`**. |
-| `storage.account_name` | String | `None` | The account key of the azure account. **It's only used when the storage type is `Azblob`**. |
-| `storage.account_key` | String | `None` | The account key of the azure account. **It's only used when the storage type is `Azblob`**. |
-| `storage.scope` | String | `None` | The scope of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
-| `storage.credential_path` | String | `None` | The credential path of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
-| `storage.credential` | String | `None` | The credential of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
-| `storage.container` | String | `None` | The container of the azure account. **It's only used when the storage type is `Azblob`**. |
-| `storage.sas_token` | String | `None` | The sas token of the azure account. **It's only used when the storage type is `Azblob`**. |
-| `storage.endpoint` | String | `None` | The endpoint of the S3 service. **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**. |
-| `storage.region` | String | `None` | The region of the S3 service. **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**. |
+| `storage.cache_path` | String | Unset | Cache configuration for object storage such as 'S3' etc. The local file cache directory. |
+| `storage.cache_capacity` | String | Unset | The local file cache capacity in bytes. |
+| `storage.bucket` | String | Unset | The S3 bucket name. **It's only used when the storage type is `S3`, `Oss` and `Gcs`**. |
+| `storage.root` | String | Unset | The S3 data will be stored in the specified prefix, for example, `s3://${bucket}/${root}`. **It's only used when the storage type is `S3`, `Oss` and `Azblob`**. |
+| `storage.access_key_id` | String | Unset | The access key id of the aws account. It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key. **It's only used when the storage type is `S3` and `Oss`**. |
+| `storage.secret_access_key` | String | Unset | The secret access key of the aws account. It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key. **It's only used when the storage type is `S3`**. |
+| `storage.access_key_secret` | String | Unset | The secret access key of the aliyun account. **It's only used when the storage type is `Oss`**. |
+| `storage.account_name` | String | Unset | The account key of the azure account. **It's only used when the storage type is `Azblob`**. |
+| `storage.account_key` | String | Unset | The account key of the azure account. **It's only used when the storage type is `Azblob`**. |
+| `storage.scope` | String | Unset | The scope of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
+| `storage.credential_path` | String | Unset | The credential path of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
+| `storage.credential` | String | Unset | The credential of the google cloud storage. **It's only used when the storage type is `Gcs`**. |
+| `storage.container` | String | Unset | The container of the azure account. **It's only used when the storage type is `Azblob`**. |
+| `storage.sas_token` | String | Unset | The sas token of the azure account. **It's only used when the storage type is `Azblob`**. |
+| `storage.endpoint` | String | Unset | The endpoint of the S3 service. **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**. |
+| `storage.region` | String | Unset | The region of the S3 service. **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**. |
| `[[region_engine]]` | -- | -- | The region engine options. You can configure multiple region engines. |
| `region_engine.mito` | -- | -- | The Mito engine options. |
| `region_engine.mito.num_workers` | Integer | `8` | Number of region workers. |
@@ -418,18 +439,20 @@
| `region_engine.mito.worker_request_batch_size` | Integer | `64` | Max batch size for a worker to handle requests. |
| `region_engine.mito.manifest_checkpoint_distance` | Integer | `10` | Number of meta action updated to trigger a new checkpoint for the manifest. |
| `region_engine.mito.compress_manifest` | Bool | `false` | Whether to compress manifest and checkpoint file by gzip (default false). |
-| `region_engine.mito.max_background_jobs` | Integer | `4` | Max number of running background jobs |
+| `region_engine.mito.max_background_flushes` | Integer | Auto | Max number of running background flush jobs (default: 1/2 of cpu cores). |
+| `region_engine.mito.max_background_compactions` | Integer | Auto | Max number of running background compaction jobs (default: 1/4 of cpu cores). |
+| `region_engine.mito.max_background_purges` | Integer | Auto | Max number of running background purge jobs (default: number of cpu cores). |
| `region_engine.mito.auto_flush_interval` | String | `1h` | Interval to auto flush a region if it has not flushed yet. |
-| `region_engine.mito.global_write_buffer_size` | String | `1GB` | Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. |
-| `region_engine.mito.global_write_buffer_reject_size` | String | `2GB` | Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size` |
-| `region_engine.mito.sst_meta_cache_size` | String | `128MB` | Cache size for SST metadata. Setting it to 0 to disable the cache. If not set, it's default to 1/32 of OS memory with a max limitation of 128MB. |
-| `region_engine.mito.vector_cache_size` | String | `512MB` | Cache size for vectors and arrow arrays. Setting it to 0 to disable the cache. If not set, it's default to 1/16 of OS memory with a max limitation of 512MB. |
-| `region_engine.mito.page_cache_size` | String | `512MB` | Cache size for pages of SST row groups. Setting it to 0 to disable the cache. If not set, it's default to 1/8 of OS memory. |
-| `region_engine.mito.selector_result_cache_size` | String | `512MB` | Cache size for time series selector (e.g. `last_value()`). Setting it to 0 to disable the cache. If not set, it's default to 1/16 of OS memory with a max limitation of 512MB. |
+| `region_engine.mito.global_write_buffer_size` | String | Auto | Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. |
+| `region_engine.mito.global_write_buffer_reject_size` | String | Auto | Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size` |
+| `region_engine.mito.sst_meta_cache_size` | String | Auto | Cache size for SST metadata. Setting it to 0 to disable the cache. If not set, it's default to 1/32 of OS memory with a max limitation of 128MB. |
+| `region_engine.mito.vector_cache_size` | String | Auto | Cache size for vectors and arrow arrays. Setting it to 0 to disable the cache. If not set, it's default to 1/16 of OS memory with a max limitation of 512MB. |
+| `region_engine.mito.page_cache_size` | String | Auto | Cache size for pages of SST row groups. Setting it to 0 to disable the cache. If not set, it's default to 1/8 of OS memory. |
+| `region_engine.mito.selector_result_cache_size` | String | Auto | Cache size for time series selector (e.g. `last_value()`). Setting it to 0 to disable the cache. If not set, it's default to 1/16 of OS memory with a max limitation of 512MB. |
| `region_engine.mito.enable_experimental_write_cache` | Bool | `false` | Whether to enable the experimental write cache. |
| `region_engine.mito.experimental_write_cache_path` | String | `""` | File system path for write cache, defaults to `{data_home}/write_cache`. |
| `region_engine.mito.experimental_write_cache_size` | String | `512MB` | Capacity for write cache. |
-| `region_engine.mito.experimental_write_cache_ttl` | String | `None` | TTL for write cache. |
+| `region_engine.mito.experimental_write_cache_ttl` | String | Unset | TTL for write cache. |
| `region_engine.mito.sst_write_buffer_size` | String | `8MB` | Buffer size for SST writing. |
| `region_engine.mito.scan_parallelism` | Integer | `0` | Parallelism to scan a region (default: 1/4 of cpu cores). - `0`: using the default value (1/4 of cpu cores). - `1`: scan in current thread. - `n`: scan in parallelism n. |
| `region_engine.mito.parallel_scan_channel_size` | Integer | `32` | Capacity of the channel to send data from parallel scan tasks to the main task. |
@@ -457,23 +480,28 @@
| `region_engine.file` | -- | -- | Enable the file engine. |
| `logging` | -- | -- | The logging options. |
| `logging.dir` | String | `/tmp/greptimedb/logs` | The directory to store the log files. If set to empty, logs will not be written to files. |
-| `logging.level` | String | `None` | The log level. Can be `info`/`debug`/`warn`/`error`. |
+| `logging.level` | String | Unset | The log level. Can be `info`/`debug`/`warn`/`error`. |
| `logging.enable_otlp_tracing` | Bool | `false` | Enable OTLP tracing. |
| `logging.otlp_endpoint` | String | `http://localhost:4317` | The OTLP tracing endpoint. |
| `logging.append_stdout` | Bool | `true` | Whether to append logs to stdout. |
| `logging.log_format` | String | `text` | The log format. Can be `text`/`json`. |
+| `logging.max_log_files` | Integer | `720` | The maximum amount of log files. |
| `logging.tracing_sample_ratio` | -- | -- | The percentage of tracing will be sampled and exported. Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1. ratio > 1 are treated as 1. Fractions < 0 are treated as 0 |
| `logging.tracing_sample_ratio.default_ratio` | Float | `1.0` | -- |
+| `logging.slow_query` | -- | -- | The slow query log options. |
+| `logging.slow_query.enable` | Bool | `false` | Whether to enable slow query log. |
+| `logging.slow_query.threshold` | String | Unset | The threshold of slow query. |
+| `logging.slow_query.sample_ratio` | Float | Unset | The sampling ratio of slow query log. The value should be in the range of (0, 1]. |
| `export_metrics` | -- | -- | The datanode can export its metrics and send to Prometheus compatible service (e.g. send to `greptimedb` itself) from remote-write API. This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape. |
| `export_metrics.enable` | Bool | `false` | whether enable export metrics. |
| `export_metrics.write_interval` | String | `30s` | The interval of export metrics. |
| `export_metrics.self_import` | -- | -- | For `standalone` mode, `self_import` is recommend to collect metrics generated by itself You must create the database before enabling it. |
-| `export_metrics.self_import.db` | String | `None` | -- |
+| `export_metrics.self_import.db` | String | Unset | -- |
| `export_metrics.remote_write` | -- | -- | -- |
| `export_metrics.remote_write.url` | String | `""` | The url the metrics send to. The url example can be: `http://127.0.0.1:4000/v1/prometheus/write?db=greptime_metrics`. |
| `export_metrics.remote_write.headers` | InlineTable | -- | HTTP headers of Prometheus remote-write carry. |
| `tracing` | -- | -- | The tracing options. Only effect when compiled with `tokio-console` feature. |
-| `tracing.tokio_console_addr` | String | `None` | The tokio console address. |
+| `tracing.tokio_console_addr` | String | Unset | The tokio console address. |
### Flownode
@@ -481,7 +509,7 @@
| Key | Type | Default | Descriptions |
| --- | -----| ------- | ----------- |
| `mode` | String | `distributed` | The running mode of the flownode. It can be `standalone` or `distributed`. |
-| `node_id` | Integer | `None` | The flownode identifier and should be unique in the cluster. |
+| `node_id` | Integer | Unset | The flownode identifier and should be unique in the cluster. |
| `grpc` | -- | -- | The gRPC server options. |
| `grpc.addr` | String | `127.0.0.1:6800` | The address to bind the gRPC server. |
| `grpc.hostname` | String | `127.0.0.1` | The hostname advertised to the metasrv, and used for connections from outside the host |
@@ -503,12 +531,17 @@
| `heartbeat.retry_interval` | String | `3s` | Interval for retrying to send heartbeat messages to the metasrv. |
| `logging` | -- | -- | The logging options. |
| `logging.dir` | String | `/tmp/greptimedb/logs` | The directory to store the log files. If set to empty, logs will not be written to files. |
-| `logging.level` | String | `None` | The log level. Can be `info`/`debug`/`warn`/`error`. |
+| `logging.level` | String | Unset | The log level. Can be `info`/`debug`/`warn`/`error`. |
| `logging.enable_otlp_tracing` | Bool | `false` | Enable OTLP tracing. |
| `logging.otlp_endpoint` | String | `http://localhost:4317` | The OTLP tracing endpoint. |
| `logging.append_stdout` | Bool | `true` | Whether to append logs to stdout. |
| `logging.log_format` | String | `text` | The log format. Can be `text`/`json`. |
+| `logging.max_log_files` | Integer | `720` | The maximum amount of log files. |
| `logging.tracing_sample_ratio` | -- | -- | The percentage of tracing will be sampled and exported. Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1. ratio > 1 are treated as 1. Fractions < 0 are treated as 0 |
| `logging.tracing_sample_ratio.default_ratio` | Float | `1.0` | -- |
+| `logging.slow_query` | -- | -- | The slow query log options. |
+| `logging.slow_query.enable` | Bool | `false` | Whether to enable slow query log. |
+| `logging.slow_query.threshold` | String | Unset | The threshold of slow query. |
+| `logging.slow_query.sample_ratio` | Float | Unset | The sampling ratio of slow query log. The value should be in the range of (0, 1]. |
| `tracing` | -- | -- | The tracing options. Only effect when compiled with `tokio-console` feature. |
-| `tracing.tokio_console_addr` | String | `None` | The tokio console address. |
+| `tracing.tokio_console_addr` | String | Unset | The tokio console address. |
diff --git a/config/datanode.example.toml b/config/datanode.example.toml
index 14fbf914e7..6e426e89cd 100644
--- a/config/datanode.example.toml
+++ b/config/datanode.example.toml
@@ -2,7 +2,7 @@
mode = "standalone"
## The datanode identifier and should be unique in the cluster.
-## +toml2docs:none-default
+## @toml2docs:none-default
node_id = 42
## Start services after regions have obtained leases.
@@ -19,24 +19,27 @@ enable_telemetry = true
## Parallelism of initializing regions.
init_regions_parallelism = 16
+## The maximum current queries allowed to be executed. Zero means unlimited.
+max_concurrent_queries = 0
+
## Deprecated, use `grpc.addr` instead.
-## +toml2docs:none-default
+## @toml2docs:none-default
rpc_addr = "127.0.0.1:3001"
## Deprecated, use `grpc.hostname` instead.
-## +toml2docs:none-default
+## @toml2docs:none-default
rpc_hostname = "127.0.0.1"
## Deprecated, use `grpc.runtime_size` instead.
-## +toml2docs:none-default
+## @toml2docs:none-default
rpc_runtime_size = 8
## Deprecated, use `grpc.rpc_max_recv_message_size` instead.
-## +toml2docs:none-default
+## @toml2docs:none-default
rpc_max_recv_message_size = "512MB"
## Deprecated, use `grpc.rpc_max_send_message_size` instead.
-## +toml2docs:none-default
+## @toml2docs:none-default
rpc_max_send_message_size = "512MB"
@@ -71,11 +74,11 @@ max_send_message_size = "512MB"
mode = "disable"
## Certificate file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
cert_path = ""
## Private key file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
key_path = ""
## Watch for Certificate and key file change and auto reload.
@@ -83,11 +86,11 @@ key_path = ""
watch = false
## The runtime options.
-[runtime]
+#+ [runtime]
## The number of threads to execute the runtime for global read operations.
-global_rt_size = 8
+#+ global_rt_size = 8
## The number of threads to execute the runtime for global write operations.
-compact_rt_size = 4
+#+ compact_rt_size = 4
## The heartbeat options.
[heartbeat]
@@ -135,7 +138,7 @@ provider = "raft_engine"
## The directory to store the WAL files.
## **It's only used when the provider is `raft_engine`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
dir = "/tmp/greptimedb/wal"
## The size of the WAL segment file.
@@ -210,6 +213,17 @@ create_index = true
## **It's only used when the provider is `kafka`**.
dump_index_interval = "60s"
+## Ignore missing entries during read WAL.
+## **It's only used when the provider is `kafka`**.
+##
+## This option ensures that when Kafka messages are deleted, the system
+## can still successfully replay memtable data without throwing an
+## out-of-range error.
+## However, enabling this option might lead to unexpected data loss,
+## as the system will skip over missing entries instead of treating
+## them as critical errors.
+overwrite_entry_start_id = false
+
# The Kafka SASL configuration.
# **It's only used when the provider is `kafka`**.
# Available SASL mechanisms:
@@ -282,83 +296,83 @@ type = "File"
## Cache configuration for object storage such as 'S3' etc.
## The local file cache directory.
-## +toml2docs:none-default
+## @toml2docs:none-default
cache_path = "/path/local_cache"
## The local file cache capacity in bytes.
-## +toml2docs:none-default
+## @toml2docs:none-default
cache_capacity = "256MB"
## The S3 bucket name.
## **It's only used when the storage type is `S3`, `Oss` and `Gcs`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
bucket = "greptimedb"
## The S3 data will be stored in the specified prefix, for example, `s3://${bucket}/${root}`.
## **It's only used when the storage type is `S3`, `Oss` and `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
root = "greptimedb"
## The access key id of the aws account.
## It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key.
## **It's only used when the storage type is `S3` and `Oss`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
access_key_id = "test"
## The secret access key of the aws account.
## It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key.
## **It's only used when the storage type is `S3`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
secret_access_key = "test"
## The secret access key of the aliyun account.
## **It's only used when the storage type is `Oss`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
access_key_secret = "test"
## The account key of the azure account.
## **It's only used when the storage type is `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
account_name = "test"
## The account key of the azure account.
## **It's only used when the storage type is `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
account_key = "test"
## The scope of the google cloud storage.
## **It's only used when the storage type is `Gcs`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
scope = "test"
## The credential path of the google cloud storage.
## **It's only used when the storage type is `Gcs`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
credential_path = "test"
## The credential of the google cloud storage.
## **It's only used when the storage type is `Gcs`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
credential = "base64-credential"
## The container of the azure account.
## **It's only used when the storage type is `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
container = "greptimedb"
## The sas token of the azure account.
## **It's only used when the storage type is `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
sas_token = ""
## The endpoint of the S3 service.
## **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
endpoint = "https://s3.amazonaws.com"
## The region of the S3 service.
## **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
region = "us-west-2"
# Custom storage options
@@ -388,7 +402,7 @@ region = "us-west-2"
[region_engine.mito]
## Number of region workers.
-num_workers = 8
+#+ num_workers = 8
## Request channel size of each worker.
worker_channel_size = 128
@@ -402,33 +416,48 @@ manifest_checkpoint_distance = 10
## Whether to compress manifest and checkpoint file by gzip (default false).
compress_manifest = false
-## Max number of running background jobs
-max_background_jobs = 4
+## Max number of running background flush jobs (default: 1/2 of cpu cores).
+## @toml2docs:none-default="Auto"
+#+ max_background_flushes = 4
+
+## Max number of running background compaction jobs (default: 1/4 of cpu cores).
+## @toml2docs:none-default="Auto"
+#+ max_background_compactions = 2
+
+## Max number of running background purge jobs (default: number of cpu cores).
+## @toml2docs:none-default="Auto"
+#+ max_background_purges = 8
## Interval to auto flush a region if it has not flushed yet.
auto_flush_interval = "1h"
## Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB.
-global_write_buffer_size = "1GB"
+## @toml2docs:none-default="Auto"
+#+ global_write_buffer_size = "1GB"
## Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size`
-global_write_buffer_reject_size = "2GB"
+## @toml2docs:none-default="Auto"
+#+ global_write_buffer_reject_size = "2GB"
## Cache size for SST metadata. Setting it to 0 to disable the cache.
## If not set, it's default to 1/32 of OS memory with a max limitation of 128MB.
-sst_meta_cache_size = "128MB"
+## @toml2docs:none-default="Auto"
+#+ sst_meta_cache_size = "128MB"
## Cache size for vectors and arrow arrays. Setting it to 0 to disable the cache.
## If not set, it's default to 1/16 of OS memory with a max limitation of 512MB.
-vector_cache_size = "512MB"
+## @toml2docs:none-default="Auto"
+#+ vector_cache_size = "512MB"
## Cache size for pages of SST row groups. Setting it to 0 to disable the cache.
## If not set, it's default to 1/8 of OS memory.
-page_cache_size = "512MB"
+## @toml2docs:none-default="Auto"
+#+ page_cache_size = "512MB"
## Cache size for time series selector (e.g. `last_value()`). Setting it to 0 to disable the cache.
## If not set, it's default to 1/16 of OS memory with a max limitation of 512MB.
-selector_result_cache_size = "512MB"
+## @toml2docs:none-default="Auto"
+#+ selector_result_cache_size = "512MB"
## Whether to enable the experimental write cache.
enable_experimental_write_cache = false
@@ -440,7 +469,7 @@ experimental_write_cache_path = ""
experimental_write_cache_size = "512MB"
## TTL for write cache.
-## +toml2docs:none-default
+## @toml2docs:none-default
experimental_write_cache_ttl = "8h"
## Buffer size for SST writing.
@@ -556,7 +585,7 @@ fork_dictionary_bytes = "1GiB"
dir = "/tmp/greptimedb/logs"
## The log level. Can be `info`/`debug`/`warn`/`error`.
-## +toml2docs:none-default
+## @toml2docs:none-default
level = "info"
## Enable OTLP tracing.
@@ -571,12 +600,28 @@ append_stdout = true
## The log format. Can be `text`/`json`.
log_format = "text"
+## The maximum amount of log files.
+max_log_files = 720
+
## The percentage of tracing will be sampled and exported.
## Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1.
## ratio > 1 are treated as 1. Fractions < 0 are treated as 0
[logging.tracing_sample_ratio]
default_ratio = 1.0
+## The slow query log options.
+[logging.slow_query]
+## Whether to enable slow query log.
+enable = false
+
+## The threshold of slow query.
+## @toml2docs:none-default
+threshold = "10s"
+
+## The sampling ratio of slow query log. The value should be in the range of (0, 1].
+## @toml2docs:none-default
+sample_ratio = 1.0
+
## The datanode can export its metrics and send to Prometheus compatible service (e.g. send to `greptimedb` itself) from remote-write API.
## This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape.
[export_metrics]
@@ -590,7 +635,7 @@ write_interval = "30s"
## For `standalone` mode, `self_import` is recommend to collect metrics generated by itself
## You must create the database before enabling it.
[export_metrics.self_import]
-## +toml2docs:none-default
+## @toml2docs:none-default
db = "greptime_metrics"
[export_metrics.remote_write]
@@ -601,7 +646,7 @@ url = ""
headers = { }
## The tracing options. Only effect when compiled with `tokio-console` feature.
-[tracing]
+#+ [tracing]
## The tokio console address.
-## +toml2docs:none-default
-tokio_console_addr = "127.0.0.1"
+## @toml2docs:none-default
+#+ tokio_console_addr = "127.0.0.1"
diff --git a/config/flownode.example.toml b/config/flownode.example.toml
index d5640062f7..ffa9924365 100644
--- a/config/flownode.example.toml
+++ b/config/flownode.example.toml
@@ -2,7 +2,7 @@
mode = "distributed"
## The flownode identifier and should be unique in the cluster.
-## +toml2docs:none-default
+## @toml2docs:none-default
node_id = 14
## The gRPC server options.
@@ -63,7 +63,7 @@ retry_interval = "3s"
dir = "/tmp/greptimedb/logs"
## The log level. Can be `info`/`debug`/`warn`/`error`.
-## +toml2docs:none-default
+## @toml2docs:none-default
level = "info"
## Enable OTLP tracing.
@@ -78,15 +78,31 @@ append_stdout = true
## The log format. Can be `text`/`json`.
log_format = "text"
+## The maximum amount of log files.
+max_log_files = 720
+
## The percentage of tracing will be sampled and exported.
## Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1.
## ratio > 1 are treated as 1. Fractions < 0 are treated as 0
[logging.tracing_sample_ratio]
default_ratio = 1.0
-## The tracing options. Only effect when compiled with `tokio-console` feature.
-[tracing]
-## The tokio console address.
-## +toml2docs:none-default
-tokio_console_addr = "127.0.0.1"
+## The slow query log options.
+[logging.slow_query]
+## Whether to enable slow query log.
+enable = false
+
+## The threshold of slow query.
+## @toml2docs:none-default
+threshold = "10s"
+
+## The sampling ratio of slow query log. The value should be in the range of (0, 1].
+## @toml2docs:none-default
+sample_ratio = 1.0
+
+## The tracing options. Only effect when compiled with `tokio-console` feature.
+#+ [tracing]
+## The tokio console address.
+## @toml2docs:none-default
+#+ tokio_console_addr = "127.0.0.1"
diff --git a/config/frontend.example.toml b/config/frontend.example.toml
index e5a7f5af89..1fb372a6d1 100644
--- a/config/frontend.example.toml
+++ b/config/frontend.example.toml
@@ -1,13 +1,13 @@
## The default timezone of the server.
-## +toml2docs:none-default
+## @toml2docs:none-default
default_timezone = "UTC"
## The runtime options.
-[runtime]
+#+ [runtime]
## The number of threads to execute the runtime for global read operations.
-global_rt_size = 8
+#+ global_rt_size = 8
## The number of threads to execute the runtime for global write operations.
-compact_rt_size = 4
+#+ compact_rt_size = 4
## The heartbeat options.
[heartbeat]
@@ -44,11 +44,11 @@ runtime_size = 8
mode = "disable"
## Certificate file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
cert_path = ""
## Private key file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
key_path = ""
## Watch for Certificate and key file change and auto reload.
@@ -76,11 +76,11 @@ runtime_size = 2
mode = "disable"
## Certificate file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
cert_path = ""
## Private key file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
key_path = ""
## Watch for Certificate and key file change and auto reload
@@ -101,11 +101,11 @@ runtime_size = 2
mode = "disable"
## Certificate file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
cert_path = ""
## Private key file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
key_path = ""
## Watch for Certificate and key file change and auto reload
@@ -170,7 +170,7 @@ tcp_nodelay = true
dir = "/tmp/greptimedb/logs"
## The log level. Can be `info`/`debug`/`warn`/`error`.
-## +toml2docs:none-default
+## @toml2docs:none-default
level = "info"
## Enable OTLP tracing.
@@ -185,12 +185,28 @@ append_stdout = true
## The log format. Can be `text`/`json`.
log_format = "text"
+## The maximum amount of log files.
+max_log_files = 720
+
## The percentage of tracing will be sampled and exported.
## Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1.
## ratio > 1 are treated as 1. Fractions < 0 are treated as 0
[logging.tracing_sample_ratio]
default_ratio = 1.0
+## The slow query log options.
+[logging.slow_query]
+## Whether to enable slow query log.
+enable = false
+
+## The threshold of slow query.
+## @toml2docs:none-default
+threshold = "10s"
+
+## The sampling ratio of slow query log. The value should be in the range of (0, 1].
+## @toml2docs:none-default
+sample_ratio = 1.0
+
## The datanode can export its metrics and send to Prometheus compatible service (e.g. send to `greptimedb` itself) from remote-write API.
## This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape.
[export_metrics]
@@ -204,7 +220,7 @@ write_interval = "30s"
## For `standalone` mode, `self_import` is recommend to collect metrics generated by itself
## You must create the database before enabling it.
[export_metrics.self_import]
-## +toml2docs:none-default
+## @toml2docs:none-default
db = "greptime_metrics"
[export_metrics.remote_write]
@@ -215,7 +231,7 @@ url = ""
headers = { }
## The tracing options. Only effect when compiled with `tokio-console` feature.
-[tracing]
+#+ [tracing]
## The tokio console address.
-## +toml2docs:none-default
-tokio_console_addr = "127.0.0.1"
+## @toml2docs:none-default
+#+ tokio_console_addr = "127.0.0.1"
diff --git a/config/metasrv.example.toml b/config/metasrv.example.toml
index dc5f091166..b80d1c164e 100644
--- a/config/metasrv.example.toml
+++ b/config/metasrv.example.toml
@@ -36,11 +36,11 @@ enable_region_failover = false
backend = "EtcdStore"
## The runtime options.
-[runtime]
+#+ [runtime]
## The number of threads to execute the runtime for global read operations.
-global_rt_size = 8
+#+ global_rt_size = 8
## The number of threads to execute the runtime for global write operations.
-compact_rt_size = 4
+#+ compact_rt_size = 4
## Procedure storage options.
[procedure]
@@ -157,7 +157,7 @@ backoff_deadline = "5mins"
dir = "/tmp/greptimedb/logs"
## The log level. Can be `info`/`debug`/`warn`/`error`.
-## +toml2docs:none-default
+## @toml2docs:none-default
level = "info"
## Enable OTLP tracing.
@@ -172,12 +172,28 @@ append_stdout = true
## The log format. Can be `text`/`json`.
log_format = "text"
+## The maximum amount of log files.
+max_log_files = 720
+
## The percentage of tracing will be sampled and exported.
## Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1.
## ratio > 1 are treated as 1. Fractions < 0 are treated as 0
[logging.tracing_sample_ratio]
default_ratio = 1.0
+## The slow query log options.
+[logging.slow_query]
+## Whether to enable slow query log.
+enable = false
+
+## The threshold of slow query.
+## @toml2docs:none-default
+threshold = "10s"
+
+## The sampling ratio of slow query log. The value should be in the range of (0, 1].
+## @toml2docs:none-default
+sample_ratio = 1.0
+
## The datanode can export its metrics and send to Prometheus compatible service (e.g. send to `greptimedb` itself) from remote-write API.
## This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape.
[export_metrics]
@@ -191,7 +207,7 @@ write_interval = "30s"
## For `standalone` mode, `self_import` is recommend to collect metrics generated by itself
## You must create the database before enabling it.
[export_metrics.self_import]
-## +toml2docs:none-default
+## @toml2docs:none-default
db = "greptime_metrics"
[export_metrics.remote_write]
@@ -202,7 +218,7 @@ url = ""
headers = { }
## The tracing options. Only effect when compiled with `tokio-console` feature.
-[tracing]
+#+ [tracing]
## The tokio console address.
-## +toml2docs:none-default
-tokio_console_addr = "127.0.0.1"
+## @toml2docs:none-default
+#+ tokio_console_addr = "127.0.0.1"
diff --git a/config/standalone.example.toml b/config/standalone.example.toml
index f7c7b2af29..52f6d5b694 100644
--- a/config/standalone.example.toml
+++ b/config/standalone.example.toml
@@ -5,7 +5,7 @@ mode = "standalone"
enable_telemetry = true
## The default timezone of the server.
-## +toml2docs:none-default
+## @toml2docs:none-default
default_timezone = "UTC"
## Initialize all regions in the background during the startup.
@@ -15,12 +15,15 @@ init_regions_in_background = false
## Parallelism of initializing regions.
init_regions_parallelism = 16
+## The maximum current queries allowed to be executed. Zero means unlimited.
+max_concurrent_queries = 0
+
## The runtime options.
-[runtime]
+#+ [runtime]
## The number of threads to execute the runtime for global read operations.
-global_rt_size = 8
+#+ global_rt_size = 8
## The number of threads to execute the runtime for global write operations.
-compact_rt_size = 4
+#+ compact_rt_size = 4
## The HTTP server options.
[http]
@@ -46,11 +49,11 @@ runtime_size = 8
mode = "disable"
## Certificate file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
cert_path = ""
## Private key file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
key_path = ""
## Watch for Certificate and key file change and auto reload.
@@ -78,11 +81,11 @@ runtime_size = 2
mode = "disable"
## Certificate file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
cert_path = ""
## Private key file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
key_path = ""
## Watch for Certificate and key file change and auto reload
@@ -103,11 +106,11 @@ runtime_size = 2
mode = "disable"
## Certificate file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
cert_path = ""
## Private key file path.
-## +toml2docs:none-default
+## @toml2docs:none-default
key_path = ""
## Watch for Certificate and key file change and auto reload
@@ -139,7 +142,7 @@ provider = "raft_engine"
## The directory to store the WAL files.
## **It's only used when the provider is `raft_engine`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
dir = "/tmp/greptimedb/wal"
## The size of the WAL segment file.
@@ -234,6 +237,17 @@ backoff_base = 2
## **It's only used when the provider is `kafka`**.
backoff_deadline = "5mins"
+## Ignore missing entries during read WAL.
+## **It's only used when the provider is `kafka`**.
+##
+## This option ensures that when Kafka messages are deleted, the system
+## can still successfully replay memtable data without throwing an
+## out-of-range error.
+## However, enabling this option might lead to unexpected data loss,
+## as the system will skip over missing entries instead of treating
+## them as critical errors.
+overwrite_entry_start_id = false
+
# The Kafka SASL configuration.
# **It's only used when the provider is `kafka`**.
# Available SASL mechanisms:
@@ -320,83 +334,83 @@ type = "File"
## Cache configuration for object storage such as 'S3' etc.
## The local file cache directory.
-## +toml2docs:none-default
+## @toml2docs:none-default
cache_path = "/path/local_cache"
## The local file cache capacity in bytes.
-## +toml2docs:none-default
+## @toml2docs:none-default
cache_capacity = "256MB"
## The S3 bucket name.
## **It's only used when the storage type is `S3`, `Oss` and `Gcs`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
bucket = "greptimedb"
## The S3 data will be stored in the specified prefix, for example, `s3://${bucket}/${root}`.
## **It's only used when the storage type is `S3`, `Oss` and `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
root = "greptimedb"
## The access key id of the aws account.
## It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key.
## **It's only used when the storage type is `S3` and `Oss`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
access_key_id = "test"
## The secret access key of the aws account.
## It's **highly recommended** to use AWS IAM roles instead of hardcoding the access key id and secret key.
## **It's only used when the storage type is `S3`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
secret_access_key = "test"
## The secret access key of the aliyun account.
## **It's only used when the storage type is `Oss`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
access_key_secret = "test"
## The account key of the azure account.
## **It's only used when the storage type is `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
account_name = "test"
## The account key of the azure account.
## **It's only used when the storage type is `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
account_key = "test"
## The scope of the google cloud storage.
## **It's only used when the storage type is `Gcs`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
scope = "test"
## The credential path of the google cloud storage.
## **It's only used when the storage type is `Gcs`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
credential_path = "test"
## The credential of the google cloud storage.
## **It's only used when the storage type is `Gcs`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
credential = "base64-credential"
## The container of the azure account.
## **It's only used when the storage type is `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
container = "greptimedb"
## The sas token of the azure account.
## **It's only used when the storage type is `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
sas_token = ""
## The endpoint of the S3 service.
## **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
endpoint = "https://s3.amazonaws.com"
## The region of the S3 service.
## **It's only used when the storage type is `S3`, `Oss`, `Gcs` and `Azblob`**.
-## +toml2docs:none-default
+## @toml2docs:none-default
region = "us-west-2"
# Custom storage options
@@ -426,7 +440,7 @@ region = "us-west-2"
[region_engine.mito]
## Number of region workers.
-num_workers = 8
+#+ num_workers = 8
## Request channel size of each worker.
worker_channel_size = 128
@@ -440,33 +454,48 @@ manifest_checkpoint_distance = 10
## Whether to compress manifest and checkpoint file by gzip (default false).
compress_manifest = false
-## Max number of running background jobs
-max_background_jobs = 4
+## Max number of running background flush jobs (default: 1/2 of cpu cores).
+## @toml2docs:none-default="Auto"
+#+ max_background_flushes = 4
+
+## Max number of running background compaction jobs (default: 1/4 of cpu cores).
+## @toml2docs:none-default="Auto"
+#+ max_background_compactions = 2
+
+## Max number of running background purge jobs (default: number of cpu cores).
+## @toml2docs:none-default="Auto"
+#+ max_background_purges = 8
## Interval to auto flush a region if it has not flushed yet.
auto_flush_interval = "1h"
## Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB.
-global_write_buffer_size = "1GB"
+## @toml2docs:none-default="Auto"
+#+ global_write_buffer_size = "1GB"
-## Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size`
-global_write_buffer_reject_size = "2GB"
+## Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size`.
+## @toml2docs:none-default="Auto"
+#+ global_write_buffer_reject_size = "2GB"
## Cache size for SST metadata. Setting it to 0 to disable the cache.
## If not set, it's default to 1/32 of OS memory with a max limitation of 128MB.
-sst_meta_cache_size = "128MB"
+## @toml2docs:none-default="Auto"
+#+ sst_meta_cache_size = "128MB"
## Cache size for vectors and arrow arrays. Setting it to 0 to disable the cache.
## If not set, it's default to 1/16 of OS memory with a max limitation of 512MB.
-vector_cache_size = "512MB"
+## @toml2docs:none-default="Auto"
+#+ vector_cache_size = "512MB"
## Cache size for pages of SST row groups. Setting it to 0 to disable the cache.
## If not set, it's default to 1/8 of OS memory.
-page_cache_size = "512MB"
+## @toml2docs:none-default="Auto"
+#+ page_cache_size = "512MB"
## Cache size for time series selector (e.g. `last_value()`). Setting it to 0 to disable the cache.
## If not set, it's default to 1/16 of OS memory with a max limitation of 512MB.
-selector_result_cache_size = "512MB"
+## @toml2docs:none-default="Auto"
+#+ selector_result_cache_size = "512MB"
## Whether to enable the experimental write cache.
enable_experimental_write_cache = false
@@ -478,7 +507,7 @@ experimental_write_cache_path = ""
experimental_write_cache_size = "512MB"
## TTL for write cache.
-## +toml2docs:none-default
+## @toml2docs:none-default
experimental_write_cache_ttl = "8h"
## Buffer size for SST writing.
@@ -600,7 +629,7 @@ fork_dictionary_bytes = "1GiB"
dir = "/tmp/greptimedb/logs"
## The log level. Can be `info`/`debug`/`warn`/`error`.
-## +toml2docs:none-default
+## @toml2docs:none-default
level = "info"
## Enable OTLP tracing.
@@ -615,12 +644,28 @@ append_stdout = true
## The log format. Can be `text`/`json`.
log_format = "text"
+## The maximum amount of log files.
+max_log_files = 720
+
## The percentage of tracing will be sampled and exported.
## Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1.
## ratio > 1 are treated as 1. Fractions < 0 are treated as 0
[logging.tracing_sample_ratio]
default_ratio = 1.0
+## The slow query log options.
+[logging.slow_query]
+## Whether to enable slow query log.
+enable = false
+
+## The threshold of slow query.
+## @toml2docs:none-default
+threshold = "10s"
+
+## The sampling ratio of slow query log. The value should be in the range of (0, 1].
+## @toml2docs:none-default
+sample_ratio = 1.0
+
## The datanode can export its metrics and send to Prometheus compatible service (e.g. send to `greptimedb` itself) from remote-write API.
## This is only used for `greptimedb` to export its own metrics internally. It's different from prometheus scrape.
[export_metrics]
@@ -631,10 +676,10 @@ enable = false
## The interval of export metrics.
write_interval = "30s"
-## For `standalone` mode, `self_import` is recommend to collect metrics generated by itself
+## For `standalone` mode, `self_import` is recommended to collect metrics generated by itself
## You must create the database before enabling it.
[export_metrics.self_import]
-## +toml2docs:none-default
+## @toml2docs:none-default
db = "greptime_metrics"
[export_metrics.remote_write]
@@ -645,7 +690,7 @@ url = ""
headers = { }
## The tracing options. Only effect when compiled with `tokio-console` feature.
-[tracing]
+#+ [tracing]
## The tokio console address.
-## +toml2docs:none-default
-tokio_console_addr = "127.0.0.1"
+## @toml2docs:none-default
+#+ tokio_console_addr = "127.0.0.1"
diff --git a/docker/dev-builder/binstall/pull_binstall.sh b/docker/dev-builder/binstall/pull_binstall.sh
new file mode 100755
index 0000000000..a14ee6c7ea
--- /dev/null
+++ b/docker/dev-builder/binstall/pull_binstall.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+set -euxo pipefail
+
+cd "$(mktemp -d)"
+# Fix version to v1.6.6, this is different than the latest version in original install script in
+# https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh
+base_url="https://github.com/cargo-bins/cargo-binstall/releases/download/v1.6.6/cargo-binstall-"
+
+os="$(uname -s)"
+if [ "$os" == "Darwin" ]; then
+ url="${base_url}universal-apple-darwin.zip"
+ curl -LO --proto '=https' --tlsv1.2 -sSf "$url"
+ unzip cargo-binstall-universal-apple-darwin.zip
+elif [ "$os" == "Linux" ]; then
+ machine="$(uname -m)"
+ if [ "$machine" == "armv7l" ]; then
+ machine="armv7"
+ fi
+ target="${machine}-unknown-linux-musl"
+ if [ "$machine" == "armv7" ]; then
+ target="${target}eabihf"
+ fi
+
+ url="${base_url}${target}.tgz"
+ curl -L --proto '=https' --tlsv1.2 -sSf "$url" | tar -xvzf -
+elif [ "${OS-}" = "Windows_NT" ]; then
+ machine="$(uname -m)"
+ target="${machine}-pc-windows-msvc"
+ url="${base_url}${target}.zip"
+ curl -LO --proto '=https' --tlsv1.2 -sSf "$url"
+ unzip "cargo-binstall-${target}.zip"
+else
+ echo "Unsupported OS ${os}"
+ exit 1
+fi
+
+./cargo-binstall -y --force cargo-binstall
+
+CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}"
+
+if ! [[ ":$PATH:" == *":$CARGO_HOME/bin:"* ]]; then
+ if [ -n "${CI:-}" ] && [ -n "${GITHUB_PATH:-}" ]; then
+ echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
+ else
+ echo
+ printf "\033[0;31mYour path is missing %s, you might want to add it.\033[0m\n" "$CARGO_HOME/bin"
+ echo
+ fi
+fi
diff --git a/docker/dev-builder/centos/Dockerfile b/docker/dev-builder/centos/Dockerfile
index af7e778e03..04327ab393 100644
--- a/docker/dev-builder/centos/Dockerfile
+++ b/docker/dev-builder/centos/Dockerfile
@@ -32,7 +32,9 @@ RUN rustup toolchain install ${RUST_TOOLCHAIN}
# Install cargo-binstall with a specific version to adapt the current rust toolchain.
# Note: if we use the latest version, we may encounter the following `use of unstable library feature 'io_error_downcast'` error.
-RUN cargo install cargo-binstall --version 1.6.6 --locked
+# compile from source take too long, so we use the precompiled binary instead
+COPY $DOCKER_BUILD_ROOT/docker/dev-builder/binstall/pull_binstall.sh /usr/local/bin/pull_binstall.sh
+RUN chmod +x /usr/local/bin/pull_binstall.sh && /usr/local/bin/pull_binstall.sh
# Install nextest.
RUN cargo binstall cargo-nextest --no-confirm
diff --git a/docker/dev-builder/ubuntu/Dockerfile b/docker/dev-builder/ubuntu/Dockerfile
index 3f76d80eff..733bfdab62 100644
--- a/docker/dev-builder/ubuntu/Dockerfile
+++ b/docker/dev-builder/ubuntu/Dockerfile
@@ -24,6 +24,15 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3.10 \
python3.10-dev
+# https://github.com/GreptimeTeam/greptimedb/actions/runs/10935485852/job/30357457188#step:3:7106
+# `aws-lc-sys` require gcc >= 10.3.0 to work, hence alias to use gcc-10
+RUN apt-get remove -y gcc-9 g++-9 cpp-9 && \
+ apt-get install -y gcc-10 g++-10 cpp-10 make cmake && \
+ ln -sf /usr/bin/gcc-10 /usr/bin/gcc && ln -sf /usr/bin/g++-10 /usr/bin/g++ && \
+ ln -sf /usr/bin/gcc-10 /usr/bin/cc && \
+ ln -sf /usr/bin/g++-10 /usr/bin/cpp && ln -sf /usr/bin/g++-10 /usr/bin/c++ && \
+ cc --version && gcc --version && g++ --version && cpp --version && c++ --version
+
# Remove Python 3.8 and install pip.
RUN apt-get -y purge python3.8 && \
apt-get -y autoremove && \
@@ -57,7 +66,9 @@ RUN rustup toolchain install ${RUST_TOOLCHAIN}
# Install cargo-binstall with a specific version to adapt the current rust toolchain.
# Note: if we use the latest version, we may encounter the following `use of unstable library feature 'io_error_downcast'` error.
-RUN cargo install cargo-binstall --version 1.6.6 --locked
+# compile from source take too long, so we use the precompiled binary instead
+COPY $DOCKER_BUILD_ROOT/docker/dev-builder/binstall/pull_binstall.sh /usr/local/bin/pull_binstall.sh
+RUN chmod +x /usr/local/bin/pull_binstall.sh && /usr/local/bin/pull_binstall.sh
# Install nextest.
RUN cargo binstall cargo-nextest --no-confirm
diff --git a/docs/benchmarks/log/README.md b/docs/benchmarks/log/README.md
index c3984b3ee6..2a884266b4 100644
--- a/docs/benchmarks/log/README.md
+++ b/docs/benchmarks/log/README.md
@@ -48,4 +48,4 @@ Please refer to [SQL query](./query.sql) for GreptimeDB and Clickhouse, and [que
## Addition
- You can tune GreptimeDB's configuration to get better performance.
-- You can setup GreptimeDB to use S3 as storage, see [here](https://docs.greptime.com/user-guide/operations/configuration/#storage-options).
+- You can setup GreptimeDB to use S3 as storage, see [here](https://docs.greptime.com/user-guide/deployments/configuration#storage-options).
diff --git a/src/servers/src/http/pprof/README.md b/docs/how-to/how-to-profile-cpu.md
similarity index 60%
rename from src/servers/src/http/pprof/README.md
rename to docs/how-to/how-to-profile-cpu.md
index b8393ae3f5..b1c5ded09e 100644
--- a/src/servers/src/http/pprof/README.md
+++ b/docs/how-to/how-to-profile-cpu.md
@@ -1,15 +1,9 @@
# Profiling CPU
-## Build GreptimeDB with `pprof` feature
-
-```bash
-cargo build --features=pprof
-```
-
## HTTP API
Sample at 99 Hertz, for 5 seconds, output report in [protobuf format](https://github.com/google/pprof/blob/master/proto/profile.proto).
```bash
-curl -s '0:4000/v1/prof/cpu' > /tmp/pprof.out
+curl -s '0:4000/debug/prof/cpu' > /tmp/pprof.out
```
Then you can use `pprof` command with the protobuf file.
@@ -19,10 +13,10 @@ go tool pprof -top /tmp/pprof.out
Sample at 99 Hertz, for 60 seconds, output report in flamegraph format.
```bash
-curl -s '0:4000/v1/prof/cpu?seconds=60&output=flamegraph' > /tmp/pprof.svg
+curl -s '0:4000/debug/prof/cpu?seconds=60&output=flamegraph' > /tmp/pprof.svg
```
Sample at 49 Hertz, for 10 seconds, output report in text format.
```bash
-curl -s '0:4000/v1/prof/cpu?seconds=10&frequency=49&output=text' > /tmp/pprof.txt
+curl -s '0:4000/debug/prof/cpu?seconds=10&frequency=49&output=text' > /tmp/pprof.txt
```
diff --git a/src/common/mem-prof/README.md b/docs/how-to/how-to-profile-memory.md
similarity index 65%
rename from src/common/mem-prof/README.md
rename to docs/how-to/how-to-profile-memory.md
index da1bbae9f0..a0fe42df55 100644
--- a/src/common/mem-prof/README.md
+++ b/docs/how-to/how-to-profile-memory.md
@@ -12,16 +12,10 @@ brew install jemalloc
sudo apt install libjemalloc-dev
```
-### [flamegraph](https://github.com/brendangregg/FlameGraph)
+### [flamegraph](https://github.com/brendangregg/FlameGraph)
```bash
-curl https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl > ./flamegraph.pl
-```
-
-### Build GreptimeDB with `mem-prof` feature.
-
-```bash
-cargo build --features=mem-prof
+curl https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl > ./flamegraph.pl
```
## Profiling
@@ -35,7 +29,7 @@ MALLOC_CONF=prof:true,lg_prof_interval:28 ./target/debug/greptime standalone sta
Dump memory profiling data through HTTP API:
```bash
-curl localhost:4000/v1/prof/mem > greptime.hprof
+curl localhost:4000/debug/prof/mem > greptime.hprof
```
You can periodically dump profiling data and compare them to find the delta memory usage.
@@ -45,6 +39,9 @@ You can periodically dump profiling data and compare them to find the delta memo
To create flamegraph according to dumped profiling data:
```bash
-jeprof --svg --base= > output.svg
-```
+sudo apt install -y libjemalloc-dev
+jeprof --collapse | ./flamegraph.pl > mem-prof.svg
+
+jeprof --base --collapse | ./flamegraph.pl > output.svg
+```
diff --git a/docs/logo-text-padding-dark.png b/docs/logo-text-padding-dark.png
index fe0c976ce1..51bc012a83 100644
Binary files a/docs/logo-text-padding-dark.png and b/docs/logo-text-padding-dark.png differ
diff --git a/docs/logo-text-padding.png b/docs/logo-text-padding.png
index ebe53a2858..f99fdd3c5d 100755
Binary files a/docs/logo-text-padding.png and b/docs/logo-text-padding.png differ
diff --git a/docs/rfcs/2024-08-06-json-datatype.md b/docs/rfcs/2024-08-06-json-datatype.md
new file mode 100644
index 0000000000..8a617a1709
--- /dev/null
+++ b/docs/rfcs/2024-08-06-json-datatype.md
@@ -0,0 +1,197 @@
+---
+Feature Name: Json Datatype
+Tracking Issue: https://github.com/GreptimeTeam/greptimedb/issues/4230
+Date: 2024-8-6
+Author: "Yuhan Wang "
+---
+
+# Summary
+This RFC proposes a method for storing and querying JSON data in the database.
+
+# Motivation
+JSON is widely used across various scenarios. Direct support for writing and querying JSON can significantly enhance the database's flexibility.
+
+# Details
+
+## Storage and Query
+
+GreptimeDB's type system is built on Arrow/DataFusion, where each data type in GreptimeDB corresponds to a data type in Arrow/DataFusion. The proposed JSON type will be implemented on top of the existing `Binary` type, leveraging the current `datatype::value::Value` and `datatype::vectors::BinaryVector` implementations, utilizing the JSONB format as the encoding of JSON data. JSON data is stored and processed similarly to binary data within the storage layer and query engine.
+
+This approach brings problems when dealing with insertions and queries of JSON columns.
+
+## Insertion
+
+Users commonly write JSON data as strings. Thus we need to make conversions between string and JSONB. There are 2 ways to do this:
+
+1. MySQL and PostgreSQL servers provide auto-conversions between strings and JSONB. When a string is inserted into a JSON column, the server will try to parse the string as JSON and convert it to JSONB. The non-JSON strings will be rejected.
+
+2. A function `parse_json` is provided to convert string to JSONB. If the string is not a valid JSON string, the function will return an error.
+
+For example, in MySQL client:
+```SQL
+CREATE TABLE IF NOT EXISTS test (
+ ts TIMESTAMP TIME INDEX,
+ a INT,
+ b JSON
+);
+
+INSERT INTO test VALUES(
+ 0,
+ 0,
+ '{
+ "name": "jHl2oDDnPc1i2OzlP5Y",
+ "timestamp": "2024-07-25T04:33:11.369386Z",
+ "attributes": { "event_attributes": 48.28667 }
+ }'
+);
+
+INSERT INTO test VALUES(
+ 0,
+ 0,
+ parse_json('{
+ "name": "jHl2oDDnPc1i2OzlP5Y",
+ "timestamp": "2024-07-25T04:33:11.369386Z",
+ "attributes": { "event_attributes": 48.28667 }
+ }')
+);
+```
+Are both valid.
+
+The dataflow of the insertion process is as follows:
+```
+Insert JSON strings directly through client:
+ Parse Insert
+ String(Serialized JSON)┌──────────┐Arrow Binary(JSONB)┌──────┐Arrow Binary(JSONB)
+ Client ---------------------->│ Server │------------------>│ Mito │------------------> Storage
+ └──────────┘ └──────┘
+ (Server identifies JSON type and performs auto-conversion)
+
+Insert JSON strings through parse_json function:
+ Parse Insert
+ String(Serialized JSON)┌──────────┐String(Serialized JSON)┌─────┐Arrow Binary(JSONB)┌──────┐Arrow Binary(JSONB)
+ Client ---------------------->│ Server │---------------------->│ UDF │------------------>│ Mito │------------------> Storage
+ └──────────┘ └─────┘ └──────┘
+ (Conversion is performed by UDF inside Query Engine)
+```
+
+Servers identify JSON column through column schema and perform auto-conversions. But when using prepared statements and binding parameters, the corresponding cached plans in datafusion generated by prepared statements cannot identify JSON columns. Under this circumstance, the servers identify JSON columns through the given parameters and perform auto-conversions.
+
+The following is an example of inserting JSON data through prepared statements:
+```Rust
+sqlx::query(
+ "create table test(ts timestamp time index, j json)",
+)
+.execute(&pool)
+.await
+.unwrap();
+
+let json = serde_json::json!({
+ "code": 200,
+ "success": true,
+ "payload": {
+ "features": [
+ "serde",
+ "json"
+ ],
+ "homepage": null
+ }
+});
+
+// Valid, can identify serde_json::Value as JSON type
+sqlx::query("insert into test values($1, $2)")
+ .bind(i)
+ .bind(json)
+ .execute(&pool)
+ .await
+ .unwrap();
+
+// Invalid, cannot identify String as JSON type
+sqlx::query("insert into test values($1, $2)")
+ .bind(i)
+ .bind(json.to_string())
+ .execute(&pool)
+ .await
+ .unwrap();
+```
+
+## Query
+
+Correspondingly, users prefer to display JSON data as strings. Thus we need to make conversions between JSON data and strings before presenting JSON data. There are also 2 ways to do this: auto-conversions on MySQL and PostgreSQL servers, and function `json_to_string`.
+
+For example, in MySQL client:
+```SQL
+SELECT b FROM test;
+
+SELECT json_to_string(b) FROM test;
+```
+Will both return the JSON as human-readable strings.
+
+Specifically, to perform auto-conversions, we attach a message to JSON data in the `metadata` of `Field` in Arrow/Datafusion schema when scanning a JSON column. Frontend servers could identify JSON data and convert it to strings.
+
+The dataflow of the query process is as follows:
+```
+Query directly through client:
+ Decode Scan
+ String(Serialized JSON)┌──────────┐Arrow Binary(JSONB)┌──────────────┐Arrow Binary(JSONB)
+ Client <----------------------│ Server │<------------------│ Query Engine │<----------------- Storage
+ └──────────┘ └──────────────┘
+(Server identifies JSON type and performs auto-conversion based on column metadata)
+
+Query through json_to_string function:
+ Scan & Decode
+ String(Serialized JSON)┌──────────┐String(Serialized JSON)┌──────────────┐Arrow Binary(JSONB)
+ Client <----------------------│ Server │<----------------------│ Query Engine │<----------------- Storage
+ └──────────┘ └──────────────┘
+ (Conversion is performed by UDF inside Query Engine)
+
+```
+
+However, if a function uses JSON type as its return type, the metadata method mentioned above is not applicable. Thus the functions of JSON type should specify the return type explicitly instead of returning a JSON type, such as `json_get_int` and `json_get_float` which return corresponding data of `INT` and `FLOAT` type respectively.
+
+## Functions
+Similar to the common JSON type, JSON data can be queried with functions.
+
+For example:
+```SQL
+CREATE TABLE IF NOT EXISTS test (
+ ts TIMESTAMP TIME INDEX,
+ a INT,
+ b JSON
+);
+
+INSERT INTO test VALUES(
+ 0,
+ 0,
+ '{
+ "name": "jHl2oDDnPc1i2OzlP5Y",
+ "timestamp": "2024-07-25T04:33:11.369386Z",
+ "attributes": { "event_attributes": 48.28667 }
+ }'
+);
+
+SELECT json_get_string(b, 'name') FROM test;
++---------------------+
+| b.name |
++---------------------+
+| jHl2oDDnPc1i2OzlP5Y |
++---------------------+
+
+SELECT json_get_float(b, 'attributes.event_attributes') FROM test;
++--------------------------------+
+| b.attributes.event_attributes |
++--------------------------------+
+| 48.28667 |
++--------------------------------+
+
+```
+And more functions can be added in the future.
+
+# Drawbacks
+
+As a general purpose JSON data type, JSONB may not be as efficient as specialized data types for specific scenarios.
+
+The auto-conversion mechanism is not supported in all scenarios. We need to find workarounds for these scenarios.
+
+# Alternatives
+
+Extract and flatten JSON schema to store in a structured format through pipeline. For nested data, we can provide nested types like `STRUCT` or `ARRAY`.
diff --git a/grafana/greptimedb.json b/grafana/greptimedb.json
index 1096ca92ed..7c6dfb0751 100644
--- a/grafana/greptimedb.json
+++ b/grafana/greptimedb.json
@@ -409,7 +409,39 @@
"fieldConfig": {
"defaults": {
"color": {
- "mode": "thresholds"
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
},
"fieldMinMax": false,
"mappings": [],
@@ -438,18 +470,16 @@
},
"id": 27,
"options": {
- "colorMode": "value",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": ["lastNotNull"],
- "fields": "",
- "values": false
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
},
- "text": {},
- "textMode": "auto",
- "wideLayout": true
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
},
"pluginVersion": "10.2.3",
"targets": [
@@ -467,7 +497,7 @@
}
],
"title": "CPU",
- "type": "stat"
+ "type": "timeseries"
},
{
"datasource": {
@@ -477,7 +507,39 @@
"fieldConfig": {
"defaults": {
"color": {
- "mode": "thresholds"
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
},
"decimals": 0,
"fieldMinMax": false,
@@ -503,18 +565,16 @@
},
"id": 28,
"options": {
- "colorMode": "value",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": ["lastNotNull"],
- "fields": "",
- "values": false
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
},
- "text": {},
- "textMode": "auto",
- "wideLayout": true
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
},
"pluginVersion": "10.2.3",
"targets": [
@@ -532,7 +592,7 @@
}
],
"title": "Memory",
- "type": "stat"
+ "type": "timeseries"
},
{
"collapsed": false,
@@ -3335,6 +3395,6 @@
"timezone": "",
"title": "GreptimeDB",
"uid": "e7097237-669b-4f8d-b751-13067afbfb68",
- "version": 15,
+ "version": 16,
"weekStart": ""
}
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index cfa276d72f..c986eedd97 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,3 +1,2 @@
[toolchain]
-channel = "nightly-2024-06-06"
-
+channel = "nightly-2024-10-19"
diff --git a/src/api/src/helper.rs b/src/api/src/helper.rs
index 101cae8802..9d8bbacff9 100644
--- a/src/api/src/helper.rs
+++ b/src/api/src/helper.rs
@@ -17,10 +17,11 @@ use std::sync::Arc;
use common_base::BitVec;
use common_decimal::decimal128::{DECIMAL128_DEFAULT_SCALE, DECIMAL128_MAX_PRECISION};
use common_decimal::Decimal128;
-use common_time::interval::IntervalUnit;
use common_time::time::Time;
use common_time::timestamp::TimeUnit;
-use common_time::{Date, DateTime, Interval, Timestamp};
+use common_time::{
+ Date, DateTime, IntervalDayTime, IntervalMonthDayNano, IntervalYearMonth, Timestamp,
+};
use datatypes::prelude::{ConcreteDataType, ValueRef};
use datatypes::scalars::ScalarVector;
use datatypes::types::{
@@ -115,6 +116,7 @@ impl From for ConcreteDataType {
ConcreteDataType::binary_datatype()
}
}
+ ColumnDataType::Json => ConcreteDataType::json_datatype(),
ColumnDataType::String => ConcreteDataType::string_datatype(),
ColumnDataType::Date => ConcreteDataType::date_datatype(),
ColumnDataType::Datetime => ConcreteDataType::datetime_datatype(),
@@ -416,6 +418,10 @@ pub fn values_with_capacity(datatype: ColumnDataType, capacity: usize) -> Values
decimal128_values: Vec::with_capacity(capacity),
..Default::default()
},
+ ColumnDataType::Json => Values {
+ string_values: Vec::with_capacity(capacity),
+ ..Default::default()
+ },
}
}
@@ -456,13 +462,11 @@ pub fn push_vals(column: &mut Column, origin_count: usize, vector: VectorRef) {
TimeUnit::Microsecond => values.time_microsecond_values.push(val.value()),
TimeUnit::Nanosecond => values.time_nanosecond_values.push(val.value()),
},
- Value::Interval(val) => match val.unit() {
- IntervalUnit::YearMonth => values.interval_year_month_values.push(val.to_i32()),
- IntervalUnit::DayTime => values.interval_day_time_values.push(val.to_i64()),
- IntervalUnit::MonthDayNano => values
- .interval_month_day_nano_values
- .push(convert_i128_to_interval(val.to_i128())),
- },
+ Value::IntervalYearMonth(val) => values.interval_year_month_values.push(val.to_i32()),
+ Value::IntervalDayTime(val) => values.interval_day_time_values.push(val.to_i64()),
+ Value::IntervalMonthDayNano(val) => values
+ .interval_month_day_nano_values
+ .push(convert_month_day_nano_to_pb(val)),
Value::Decimal128(val) => values.decimal128_values.push(convert_to_pb_decimal128(val)),
Value::List(_) | Value::Duration(_) => unreachable!(),
});
@@ -507,14 +511,12 @@ fn ddl_request_type(request: &DdlRequest) -> &'static str {
}
}
-/// Converts an i128 value to google protobuf type [IntervalMonthDayNano].
-pub fn convert_i128_to_interval(v: i128) -> v1::IntervalMonthDayNano {
- let interval = Interval::from_i128(v);
- let (months, days, nanoseconds) = interval.to_month_day_nano();
+/// Converts an interval to google protobuf type [IntervalMonthDayNano].
+pub fn convert_month_day_nano_to_pb(v: IntervalMonthDayNano) -> v1::IntervalMonthDayNano {
v1::IntervalMonthDayNano {
- months,
- days,
- nanoseconds,
+ months: v.months,
+ days: v.days,
+ nanoseconds: v.nanoseconds,
}
}
@@ -562,11 +564,15 @@ pub fn pb_value_to_value_ref<'a>(
ValueData::TimeMillisecondValue(t) => ValueRef::Time(Time::new_millisecond(*t)),
ValueData::TimeMicrosecondValue(t) => ValueRef::Time(Time::new_microsecond(*t)),
ValueData::TimeNanosecondValue(t) => ValueRef::Time(Time::new_nanosecond(*t)),
- ValueData::IntervalYearMonthValue(v) => ValueRef::Interval(Interval::from_i32(*v)),
- ValueData::IntervalDayTimeValue(v) => ValueRef::Interval(Interval::from_i64(*v)),
+ ValueData::IntervalYearMonthValue(v) => {
+ ValueRef::IntervalYearMonth(IntervalYearMonth::from_i32(*v))
+ }
+ ValueData::IntervalDayTimeValue(v) => {
+ ValueRef::IntervalDayTime(IntervalDayTime::from_i64(*v))
+ }
ValueData::IntervalMonthDayNanoValue(v) => {
- let interval = Interval::from_month_day_nano(v.months, v.days, v.nanoseconds);
- ValueRef::Interval(interval)
+ let interval = IntervalMonthDayNano::new(v.months, v.days, v.nanoseconds);
+ ValueRef::IntervalMonthDayNano(interval)
}
ValueData::Decimal128Value(v) => {
// get precision and scale from datatype_extension
@@ -657,7 +663,7 @@ pub fn pb_values_to_vector_ref(data_type: &ConcreteDataType, values: Values) ->
IntervalType::MonthDayNano(_) => {
Arc::new(IntervalMonthDayNanoVector::from_iter_values(
values.interval_month_day_nano_values.iter().map(|x| {
- Interval::from_month_day_nano(x.months, x.days, x.nanoseconds).to_i128()
+ IntervalMonthDayNano::new(x.months, x.days, x.nanoseconds).to_i128()
}),
))
}
@@ -802,18 +808,18 @@ pub fn pb_values_to_values(data_type: &ConcreteDataType, values: Values) -> Vec<
ConcreteDataType::Interval(IntervalType::YearMonth(_)) => values
.interval_year_month_values
.into_iter()
- .map(|v| Value::Interval(Interval::from_i32(v)))
+ .map(|v| Value::IntervalYearMonth(IntervalYearMonth::from_i32(v)))
.collect(),
ConcreteDataType::Interval(IntervalType::DayTime(_)) => values
.interval_day_time_values
.into_iter()
- .map(|v| Value::Interval(Interval::from_i64(v)))
+ .map(|v| Value::IntervalDayTime(IntervalDayTime::from_i64(v)))
.collect(),
ConcreteDataType::Interval(IntervalType::MonthDayNano(_)) => values
.interval_month_day_nano_values
.into_iter()
.map(|v| {
- Value::Interval(Interval::from_month_day_nano(
+ Value::IntervalMonthDayNano(IntervalMonthDayNano::new(
v.months,
v.days,
v.nanoseconds,
@@ -941,18 +947,16 @@ pub fn to_proto_value(value: Value) -> Option {
value_data: Some(ValueData::TimeNanosecondValue(v.value())),
},
},
- Value::Interval(v) => match v.unit() {
- IntervalUnit::YearMonth => v1::Value {
- value_data: Some(ValueData::IntervalYearMonthValue(v.to_i32())),
- },
- IntervalUnit::DayTime => v1::Value {
- value_data: Some(ValueData::IntervalDayTimeValue(v.to_i64())),
- },
- IntervalUnit::MonthDayNano => v1::Value {
- value_data: Some(ValueData::IntervalMonthDayNanoValue(
- convert_i128_to_interval(v.to_i128()),
- )),
- },
+ Value::IntervalYearMonth(v) => v1::Value {
+ value_data: Some(ValueData::IntervalYearMonthValue(v.to_i32())),
+ },
+ Value::IntervalDayTime(v) => v1::Value {
+ value_data: Some(ValueData::IntervalDayTimeValue(v.to_i64())),
+ },
+ Value::IntervalMonthDayNano(v) => v1::Value {
+ value_data: Some(ValueData::IntervalMonthDayNanoValue(
+ convert_month_day_nano_to_pb(v),
+ )),
},
Value::Decimal128(v) => v1::Value {
value_data: Some(ValueData::Decimal128Value(convert_to_pb_decimal128(v))),
@@ -1044,13 +1048,11 @@ pub fn value_to_grpc_value(value: Value) -> GrpcValue {
TimeUnit::Microsecond => ValueData::TimeMicrosecondValue(v.value()),
TimeUnit::Nanosecond => ValueData::TimeNanosecondValue(v.value()),
}),
- Value::Interval(v) => Some(match v.unit() {
- IntervalUnit::YearMonth => ValueData::IntervalYearMonthValue(v.to_i32()),
- IntervalUnit::DayTime => ValueData::IntervalDayTimeValue(v.to_i64()),
- IntervalUnit::MonthDayNano => {
- ValueData::IntervalMonthDayNanoValue(convert_i128_to_interval(v.to_i128()))
- }
- }),
+ Value::IntervalYearMonth(v) => Some(ValueData::IntervalYearMonthValue(v.to_i32())),
+ Value::IntervalDayTime(v) => Some(ValueData::IntervalDayTimeValue(v.to_i64())),
+ Value::IntervalMonthDayNano(v) => Some(ValueData::IntervalMonthDayNanoValue(
+ convert_month_day_nano_to_pb(v),
+ )),
Value::Decimal128(v) => Some(ValueData::Decimal128Value(convert_to_pb_decimal128(v))),
Value::List(_) | Value::Duration(_) => unreachable!(),
},
@@ -1061,6 +1063,7 @@ pub fn value_to_grpc_value(value: Value) -> GrpcValue {
mod tests {
use std::sync::Arc;
+ use common_time::interval::IntervalUnit;
use datatypes::types::{
Int32Type, IntervalDayTimeType, IntervalMonthDayNanoType, IntervalYearMonthType,
TimeMillisecondType, TimeSecondType, TimestampMillisecondType, TimestampSecondType,
@@ -1506,11 +1509,11 @@ mod tests {
#[test]
fn test_convert_i128_to_interval() {
- let i128_val = 3000;
- let interval = convert_i128_to_interval(i128_val);
+ let i128_val = 3;
+ let interval = convert_month_day_nano_to_pb(IntervalMonthDayNano::from_i128(i128_val));
assert_eq!(interval.months, 0);
assert_eq!(interval.days, 0);
- assert_eq!(interval.nanoseconds, 3000);
+ assert_eq!(interval.nanoseconds, 3);
}
#[test]
@@ -1590,9 +1593,9 @@ mod tests {
},
);
let expect = vec![
- Value::Interval(Interval::from_year_month(1_i32)),
- Value::Interval(Interval::from_year_month(2_i32)),
- Value::Interval(Interval::from_year_month(3_i32)),
+ Value::IntervalYearMonth(IntervalYearMonth::new(1_i32)),
+ Value::IntervalYearMonth(IntervalYearMonth::new(2_i32)),
+ Value::IntervalYearMonth(IntervalYearMonth::new(3_i32)),
];
assert_eq!(expect, actual);
@@ -1605,9 +1608,9 @@ mod tests {
},
);
let expect = vec![
- Value::Interval(Interval::from_i64(1_i64)),
- Value::Interval(Interval::from_i64(2_i64)),
- Value::Interval(Interval::from_i64(3_i64)),
+ Value::IntervalDayTime(IntervalDayTime::from_i64(1_i64)),
+ Value::IntervalDayTime(IntervalDayTime::from_i64(2_i64)),
+ Value::IntervalDayTime(IntervalDayTime::from_i64(3_i64)),
];
assert_eq!(expect, actual);
@@ -1636,9 +1639,9 @@ mod tests {
},
);
let expect = vec![
- Value::Interval(Interval::from_month_day_nano(1, 2, 3)),
- Value::Interval(Interval::from_month_day_nano(5, 6, 7)),
- Value::Interval(Interval::from_month_day_nano(9, 10, 11)),
+ Value::IntervalMonthDayNano(IntervalMonthDayNano::new(1, 2, 3)),
+ Value::IntervalMonthDayNano(IntervalMonthDayNano::new(5, 6, 7)),
+ Value::IntervalMonthDayNano(IntervalMonthDayNano::new(9, 10, 11)),
];
assert_eq!(expect, actual);
}
diff --git a/src/auth/src/common.rs b/src/auth/src/common.rs
index 3aad89920d..8a13e3fc3d 100644
--- a/src/auth/src/common.rs
+++ b/src/auth/src/common.rs
@@ -75,6 +75,16 @@ pub enum Password<'a> {
PgMD5(HashedPassword<'a>, Salt<'a>),
}
+impl Password<'_> {
+ pub fn r#type(&self) -> &str {
+ match self {
+ Password::PlainText(_) => "plain_text",
+ Password::MysqlNativePassword(_, _) => "mysql_native_password",
+ Password::PgMD5(_, _) => "pg_md5",
+ }
+ }
+}
+
pub fn auth_mysql(
auth_data: HashedPassword,
salt: Salt,
diff --git a/src/auth/src/error.rs b/src/auth/src/error.rs
index 281c45234d..7ed748559b 100644
--- a/src/auth/src/error.rs
+++ b/src/auth/src/error.rs
@@ -89,7 +89,7 @@ impl ErrorExt for Error {
Error::FileWatch { .. } => StatusCode::InvalidArguments,
Error::InternalState { .. } => StatusCode::Unexpected,
Error::Io { .. } => StatusCode::StorageUnavailable,
- Error::AuthBackend { .. } => StatusCode::Internal,
+ Error::AuthBackend { source, .. } => source.status_code(),
Error::UserNotFound { .. } => StatusCode::UserNotFound,
Error::UnsupportedPasswordType { .. } => StatusCode::UnsupportedPasswordType,
diff --git a/src/auth/src/user_provider.rs b/src/auth/src/user_provider.rs
index b00f3cf29d..526e72b775 100644
--- a/src/auth/src/user_provider.rs
+++ b/src/auth/src/user_provider.rs
@@ -57,6 +57,11 @@ pub trait UserProvider: Send + Sync {
self.authorize(catalog, schema, &user_info).await?;
Ok(user_info)
}
+
+ /// Returns whether this user provider implementation is backed by an external system.
+ fn external(&self) -> bool {
+ false
+ }
}
fn load_credential_from_file(filepath: &str) -> Result>>> {
diff --git a/src/auth/src/user_provider/static_user_provider.rs b/src/auth/src/user_provider/static_user_provider.rs
index 9e05671219..24093d5e37 100644
--- a/src/auth/src/user_provider/static_user_provider.rs
+++ b/src/auth/src/user_provider/static_user_provider.rs
@@ -33,7 +33,7 @@ impl StaticUserProvider {
value: value.to_string(),
msg: "StaticUserProviderOption must be in format ` :`",
})?;
- return match mode {
+ match mode {
"file" => {
let users = load_credential_from_file(content)?
.context(InvalidConfigSnafu {
@@ -58,7 +58,7 @@ impl StaticUserProvider {
msg: "StaticUserProviderOption must be in format `file:` or `cmd:`",
}
.fail(),
- };
+ }
}
}
diff --git a/src/catalog/Cargo.toml b/src/catalog/Cargo.toml
index a484171733..a5ad92e891 100644
--- a/src/catalog/Cargo.toml
+++ b/src/catalog/Cargo.toml
@@ -22,8 +22,10 @@ common-config.workspace = true
common-error.workspace = true
common-macro.workspace = true
common-meta.workspace = true
+common-procedure.workspace = true
common-query.workspace = true
common-recordbatch.workspace = true
+common-runtime.workspace = true
common-telemetry.workspace = true
common-time.workspace = true
common-version.workspace = true
@@ -48,6 +50,7 @@ sql.workspace = true
store-api.workspace = true
table.workspace = true
tokio.workspace = true
+tokio-stream = "0.1"
[dev-dependencies]
cache.workspace = true
diff --git a/src/catalog/src/error.rs b/src/catalog/src/error.rs
index d44a5b7683..0d9e96ab6a 100644
--- a/src/catalog/src/error.rs
+++ b/src/catalog/src/error.rs
@@ -50,13 +50,20 @@ pub enum Error {
source: BoxedError,
},
- #[snafu(display("Failed to list nodes in cluster: {source}"))]
+ #[snafu(display("Failed to list nodes in cluster"))]
ListNodes {
#[snafu(implicit)]
location: Location,
source: BoxedError,
},
+ #[snafu(display("Failed to region stats in cluster"))]
+ ListRegionStats {
+ #[snafu(implicit)]
+ location: Location,
+ source: BoxedError,
+ },
+
#[snafu(display("Failed to list flows in catalog {catalog}"))]
ListFlows {
#[snafu(implicit)]
@@ -82,6 +89,32 @@ pub enum Error {
location: Location,
},
+ #[snafu(display("Failed to get information extension client"))]
+ GetInformationExtension {
+ #[snafu(implicit)]
+ location: Location,
+ },
+
+ #[snafu(display("Failed to list procedures"))]
+ ListProcedures {
+ #[snafu(implicit)]
+ location: Location,
+ source: BoxedError,
+ },
+
+ #[snafu(display("Procedure id not found"))]
+ ProcedureIdNotFound {
+ #[snafu(implicit)]
+ location: Location,
+ },
+
+ #[snafu(display("convert proto data error"))]
+ ConvertProtoData {
+ #[snafu(implicit)]
+ location: Location,
+ source: BoxedError,
+ },
+
#[snafu(display("Failed to re-compile script due to internal error"))]
CompileScriptInternal {
#[snafu(implicit)]
@@ -266,7 +299,9 @@ impl ErrorExt for Error {
| Error::FindRegionRoutes { .. }
| Error::CacheNotFound { .. }
| Error::CastManager { .. }
- | Error::Json { .. } => StatusCode::Unexpected,
+ | Error::Json { .. }
+ | Error::GetInformationExtension { .. }
+ | Error::ProcedureIdNotFound { .. } => StatusCode::Unexpected,
Error::ViewPlanColumnsChanged { .. } => StatusCode::InvalidArguments,
@@ -283,7 +318,10 @@ impl ErrorExt for Error {
| Error::ListNodes { source, .. }
| Error::ListSchemas { source, .. }
| Error::ListTables { source, .. }
- | Error::ListFlows { source, .. } => source.status_code(),
+ | Error::ListFlows { source, .. }
+ | Error::ListProcedures { source, .. }
+ | Error::ListRegionStats { source, .. }
+ | Error::ConvertProtoData { source, .. } => source.status_code(),
Error::CreateTable { source, .. } => source.status_code(),
diff --git a/src/catalog/src/kvbackend/manager.rs b/src/catalog/src/kvbackend/manager.rs
index feb5e31d09..ca20805d37 100644
--- a/src/catalog/src/kvbackend/manager.rs
+++ b/src/catalog/src/kvbackend/manager.rs
@@ -21,7 +21,6 @@ use common_catalog::consts::{
DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, INFORMATION_SCHEMA_NAME, NUMBERS_TABLE_ID,
PG_CATALOG_NAME,
};
-use common_config::Mode;
use common_error::ext::BoxedError;
use common_meta::cache::{LayeredCacheRegistryRef, ViewInfoCacheRef};
use common_meta::key::catalog_name::CatalogNameKey;
@@ -31,9 +30,9 @@ use common_meta::key::table_info::TableInfoValue;
use common_meta::key::table_name::TableNameKey;
use common_meta::key::{TableMetadataManager, TableMetadataManagerRef};
use common_meta::kv_backend::KvBackendRef;
+use common_procedure::ProcedureManagerRef;
use futures_util::stream::BoxStream;
use futures_util::{StreamExt, TryStreamExt};
-use meta_client::client::MetaClient;
use moka::sync::Cache;
use partition::manager::{PartitionRuleManager, PartitionRuleManagerRef};
use session::context::{Channel, QueryContext};
@@ -42,12 +41,14 @@ use table::dist_table::DistTable;
use table::table::numbers::{NumbersTable, NUMBERS_TABLE_NAME};
use table::table_name::TableName;
use table::TableRef;
+use tokio::sync::Semaphore;
+use tokio_stream::wrappers::ReceiverStream;
use crate::error::{
CacheNotFoundSnafu, GetTableCacheSnafu, InvalidTableInfoInCatalogSnafu, ListCatalogsSnafu,
ListSchemasSnafu, ListTablesSnafu, Result, TableMetadataManagerSnafu,
};
-use crate::information_schema::InformationSchemaProvider;
+use crate::information_schema::{InformationExtensionRef, InformationSchemaProvider};
use crate::kvbackend::TableCacheRef;
use crate::system_schema::pg_catalog::PGCatalogProvider;
use crate::system_schema::SystemSchemaProvider;
@@ -60,27 +61,31 @@ use crate::CatalogManager;
/// comes from `SystemCatalog`, which is static and read-only.
#[derive(Clone)]
pub struct KvBackendCatalogManager {
- mode: Mode,
- meta_client: Option>,
+ /// Provides the extension methods for the `information_schema` tables
+ information_extension: InformationExtensionRef,
+ /// Manages partition rules.
partition_manager: PartitionRuleManagerRef,
+ /// Manages table metadata.
table_metadata_manager: TableMetadataManagerRef,
/// A sub-CatalogManager that handles system tables
system_catalog: SystemCatalog,
+ /// Cache registry for all caches.
cache_registry: LayeredCacheRegistryRef,
+ /// Only available in `Standalone` mode.
+ procedure_manager: Option,
}
const CATALOG_CACHE_MAX_CAPACITY: u64 = 128;
impl KvBackendCatalogManager {
pub fn new(
- mode: Mode,
- meta_client: Option>,
+ information_extension: InformationExtensionRef,
backend: KvBackendRef,
cache_registry: LayeredCacheRegistryRef,
+ procedure_manager: Option,
) -> Arc {
Arc::new_cyclic(|me| Self {
- mode,
- meta_client,
+ information_extension,
partition_manager: Arc::new(PartitionRuleManager::new(
backend.clone(),
cache_registry
@@ -104,23 +109,19 @@ impl KvBackendCatalogManager {
backend,
},
cache_registry,
+ procedure_manager,
})
}
- /// Returns the server running mode.
- pub fn running_mode(&self) -> &Mode {
- &self.mode
- }
-
pub fn view_info_cache(&self) -> Result {
self.cache_registry.get().context(CacheNotFoundSnafu {
name: "view_info_cache",
})
}
- /// Returns the `[MetaClient]`.
- pub fn meta_client(&self) -> Option> {
- self.meta_client.clone()
+ /// Returns the [`InformationExtension`].
+ pub fn information_extension(&self) -> InformationExtensionRef {
+ self.information_extension.clone()
}
pub fn partition_manager(&self) -> PartitionRuleManagerRef {
@@ -130,6 +131,10 @@ impl KvBackendCatalogManager {
pub fn table_metadata_manager_ref(&self) -> &TableMetadataManagerRef {
&self.table_metadata_manager
}
+
+ pub fn procedure_manager(&self) -> Option {
+ self.procedure_manager.clone()
+ }
}
#[async_trait::async_trait]
@@ -179,21 +184,18 @@ impl CatalogManager for KvBackendCatalogManager {
schema: &str,
query_ctx: Option<&QueryContext>,
) -> Result> {
- let stream = self
+ let mut tables = self
.table_metadata_manager
.table_name_manager()
- .tables(catalog, schema);
- let mut tables = stream
+ .tables(catalog, schema)
+ .map_ok(|(table_name, _)| table_name)
.try_collect::>()
.await
.map_err(BoxedError::new)
- .context(ListTablesSnafu { catalog, schema })?
- .into_iter()
- .map(|(k, _)| k)
- .collect::>();
- tables.extend_from_slice(&self.system_catalog.table_names(schema, query_ctx));
+ .context(ListTablesSnafu { catalog, schema })?;
- Ok(tables.into_iter().collect())
+ tables.extend(self.system_catalog.table_names(schema, query_ctx));
+ Ok(tables)
}
async fn catalog_exists(&self, catalog: &str) -> Result {
@@ -303,36 +305,68 @@ impl CatalogManager for KvBackendCatalogManager {
}
});
- let table_id_stream = self
- .table_metadata_manager
- .table_name_manager()
- .tables(catalog, schema)
- .map_ok(|(_, v)| v.table_id());
const BATCH_SIZE: usize = 128;
- let user_tables = try_stream!({
+ const CONCURRENCY: usize = 8;
+
+ let (tx, rx) = tokio::sync::mpsc::channel(64);
+ let metadata_manager = self.table_metadata_manager.clone();
+ let catalog = catalog.to_string();
+ let schema = schema.to_string();
+ let semaphore = Arc::new(Semaphore::new(CONCURRENCY));
+
+ common_runtime::spawn_global(async move {
+ let table_id_stream = metadata_manager
+ .table_name_manager()
+ .tables(&catalog, &schema)
+ .map_ok(|(_, v)| v.table_id());
// Split table ids into chunks
let mut table_id_chunks = table_id_stream.ready_chunks(BATCH_SIZE);
while let Some(table_ids) = table_id_chunks.next().await {
- let table_ids = table_ids
+ let table_ids = match table_ids
.into_iter()
.collect::, _>>()
.map_err(BoxedError::new)
- .context(ListTablesSnafu { catalog, schema })?;
+ .context(ListTablesSnafu {
+ catalog: &catalog,
+ schema: &schema,
+ }) {
+ Ok(table_ids) => table_ids,
+ Err(e) => {
+ let _ = tx.send(Err(e)).await;
+ return;
+ }
+ };
- let table_info_values = self
- .table_metadata_manager
- .table_info_manager()
- .batch_get(&table_ids)
- .await
- .context(TableMetadataManagerSnafu)?;
+ let metadata_manager = metadata_manager.clone();
+ let tx = tx.clone();
+ let semaphore = semaphore.clone();
+ common_runtime::spawn_global(async move {
+ // we don't explicitly close the semaphore so just ignore the potential error.
+ let _ = semaphore.acquire().await;
+ let table_info_values = match metadata_manager
+ .table_info_manager()
+ .batch_get(&table_ids)
+ .await
+ .context(TableMetadataManagerSnafu)
+ {
+ Ok(table_info_values) => table_info_values,
+ Err(e) => {
+ let _ = tx.send(Err(e)).await;
+ return;
+ }
+ };
- for table_info_value in table_info_values.into_values() {
- yield build_table(table_info_value)?;
- }
+ for table in table_info_values.into_values().map(build_table) {
+ if tx.send(table).await.is_err() {
+ return;
+ }
+ }
+ });
}
});
+ let user_tables = ReceiverStream::new(rx);
Box::pin(sys_tables.chain(user_tables))
}
}
diff --git a/src/catalog/src/system_schema/information_schema.rs b/src/catalog/src/system_schema/information_schema.rs
index 93dfaa75b5..4101887cb4 100644
--- a/src/catalog/src/system_schema/information_schema.rs
+++ b/src/catalog/src/system_schema/information_schema.rs
@@ -18,7 +18,9 @@ pub mod flows;
mod information_memory_table;
pub mod key_column_usage;
mod partitions;
+mod procedure_info;
mod region_peers;
+mod region_statistics;
mod runtime_metrics;
pub mod schemata;
mod table_constraints;
@@ -30,7 +32,11 @@ use std::collections::HashMap;
use std::sync::{Arc, Weak};
use common_catalog::consts::{self, DEFAULT_CATALOG_NAME, INFORMATION_SCHEMA_NAME};
+use common_error::ext::ErrorExt;
+use common_meta::cluster::NodeInfo;
+use common_meta::datanode::RegionStat;
use common_meta::key::flow::FlowMetadataManager;
+use common_procedure::ProcedureInfo;
use common_recordbatch::SendableRecordBatchStream;
use datatypes::schema::SchemaRef;
use lazy_static::lazy_static;
@@ -43,7 +49,7 @@ use views::InformationSchemaViews;
use self::columns::InformationSchemaColumns;
use super::{SystemSchemaProviderInner, SystemTable, SystemTableRef};
-use crate::error::Result;
+use crate::error::{Error, Result};
use crate::system_schema::information_schema::cluster_info::InformationSchemaClusterInfo;
use crate::system_schema::information_schema::flows::InformationSchemaFlows;
use crate::system_schema::information_schema::information_memory_table::get_schema_columns;
@@ -188,6 +194,16 @@ impl SystemSchemaProviderInner for InformationSchemaProvider {
self.catalog_name.clone(),
self.flow_metadata_manager.clone(),
)) as _),
+ PROCEDURE_INFO => Some(
+ Arc::new(procedure_info::InformationSchemaProcedureInfo::new(
+ self.catalog_manager.clone(),
+ )) as _,
+ ),
+ REGION_STATISTICS => Some(Arc::new(
+ region_statistics::InformationSchemaRegionStatistics::new(
+ self.catalog_manager.clone(),
+ ),
+ ) as _),
_ => None,
}
}
@@ -235,6 +251,14 @@ impl InformationSchemaProvider {
CLUSTER_INFO.to_string(),
self.build_table(CLUSTER_INFO).unwrap(),
);
+ tables.insert(
+ PROCEDURE_INFO.to_string(),
+ self.build_table(PROCEDURE_INFO).unwrap(),
+ );
+ tables.insert(
+ REGION_STATISTICS.to_string(),
+ self.build_table(REGION_STATISTICS).unwrap(),
+ );
}
tables.insert(TABLES.to_string(), self.build_table(TABLES).unwrap());
@@ -250,7 +274,6 @@ impl InformationSchemaProvider {
self.build_table(TABLE_CONSTRAINTS).unwrap(),
);
tables.insert(FLOWS.to_string(), self.build_table(FLOWS).unwrap());
-
// Add memory tables
for name in MEMORY_TABLES.iter() {
tables.insert((*name).to_string(), self.build_table(name).expect(name));
@@ -299,3 +322,39 @@ where
InformationTable::to_stream(self, request)
}
}
+
+pub type InformationExtensionRef = Arc + Send + Sync>;
+
+/// The `InformationExtension` trait provides the extension methods for the `information_schema` tables.
+#[async_trait::async_trait]
+pub trait InformationExtension {
+ type Error: ErrorExt;
+
+ /// Gets the nodes information.
+ async fn nodes(&self) -> std::result::Result, Self::Error>;
+
+ /// Gets the procedures information.
+ async fn procedures(&self) -> std::result::Result, Self::Error>;
+
+ /// Gets the region statistics.
+ async fn region_stats(&self) -> std::result::Result, Self::Error>;
+}
+
+pub struct NoopInformationExtension;
+
+#[async_trait::async_trait]
+impl InformationExtension for NoopInformationExtension {
+ type Error = Error;
+
+ async fn nodes(&self) -> std::result::Result, Self::Error> {
+ Ok(vec![])
+ }
+
+ async fn procedures(&self) -> std::result::Result, Self::Error> {
+ Ok(vec![])
+ }
+
+ async fn region_stats(&self) -> std::result::Result, Self::Error> {
+ Ok(vec![])
+ }
+}
diff --git a/src/catalog/src/system_schema/information_schema/cluster_info.rs b/src/catalog/src/system_schema/information_schema/cluster_info.rs
index e85e210304..1ab700497c 100644
--- a/src/catalog/src/system_schema/information_schema/cluster_info.rs
+++ b/src/catalog/src/system_schema/information_schema/cluster_info.rs
@@ -17,13 +17,10 @@ use std::time::Duration;
use arrow_schema::SchemaRef as ArrowSchemaRef;
use common_catalog::consts::INFORMATION_SCHEMA_CLUSTER_INFO_TABLE_ID;
-use common_config::Mode;
use common_error::ext::BoxedError;
-use common_meta::cluster::{ClusterInfo, NodeInfo, NodeStatus};
-use common_meta::peer::Peer;
+use common_meta::cluster::NodeInfo;
use common_recordbatch::adapter::RecordBatchStreamAdapter;
use common_recordbatch::{RecordBatch, SendableRecordBatchStream};
-use common_telemetry::warn;
use common_time::timestamp::Timestamp;
use datafusion::execution::TaskContext;
use datafusion::physical_plan::stream::RecordBatchStreamAdapter as DfRecordBatchStreamAdapter;
@@ -40,7 +37,7 @@ use snafu::ResultExt;
use store_api::storage::{ScanRequest, TableId};
use super::CLUSTER_INFO;
-use crate::error::{CreateRecordBatchSnafu, InternalSnafu, ListNodesSnafu, Result};
+use crate::error::{CreateRecordBatchSnafu, InternalSnafu, Result};
use crate::system_schema::information_schema::{InformationTable, Predicates};
use crate::system_schema::utils;
use crate::CatalogManager;
@@ -70,7 +67,6 @@ const INIT_CAPACITY: usize = 42;
pub(super) struct InformationSchemaClusterInfo {
schema: SchemaRef,
catalog_manager: Weak,
- start_time_ms: u64,
}
impl InformationSchemaClusterInfo {
@@ -78,7 +74,6 @@ impl InformationSchemaClusterInfo {
Self {
schema: Self::schema(),
catalog_manager,
- start_time_ms: common_time::util::current_time_millis() as u64,
}
}
@@ -100,11 +95,7 @@ impl InformationSchemaClusterInfo {
}
fn builder(&self) -> InformationSchemaClusterInfoBuilder {
- InformationSchemaClusterInfoBuilder::new(
- self.schema.clone(),
- self.catalog_manager.clone(),
- self.start_time_ms,
- )
+ InformationSchemaClusterInfoBuilder::new(self.schema.clone(), self.catalog_manager.clone())
}
}
@@ -144,7 +135,6 @@ impl InformationTable for InformationSchemaClusterInfo {
struct InformationSchemaClusterInfoBuilder {
schema: SchemaRef,
- start_time_ms: u64,
catalog_manager: Weak,
peer_ids: Int64VectorBuilder,
@@ -158,11 +148,7 @@ struct InformationSchemaClusterInfoBuilder {
}
impl InformationSchemaClusterInfoBuilder {
- fn new(
- schema: SchemaRef,
- catalog_manager: Weak,
- start_time_ms: u64,
- ) -> Self {
+ fn new(schema: SchemaRef, catalog_manager: Weak) -> Self {
Self {
schema,
catalog_manager,
@@ -174,56 +160,17 @@ impl InformationSchemaClusterInfoBuilder {
start_times: TimestampMillisecondVectorBuilder::with_capacity(INIT_CAPACITY),
uptimes: StringVectorBuilder::with_capacity(INIT_CAPACITY),
active_times: StringVectorBuilder::with_capacity(INIT_CAPACITY),
- start_time_ms,
}
}
/// Construct the `information_schema.cluster_info` virtual table
async fn make_cluster_info(&mut self, request: Option) -> Result {
let predicates = Predicates::from_scan_request(&request);
- let mode = utils::running_mode(&self.catalog_manager)?.unwrap_or(Mode::Standalone);
-
- match mode {
- Mode::Standalone => {
- let build_info = common_version::build_info();
-
- self.add_node_info(
- &predicates,
- NodeInfo {
- // For the standalone:
- // - id always 0
- // - empty string for peer_addr
- peer: Peer {
- id: 0,
- addr: "".to_string(),
- },
- last_activity_ts: -1,
- status: NodeStatus::Standalone,
- version: build_info.version.to_string(),
- git_commit: build_info.commit_short.to_string(),
- // Use `self.start_time_ms` instead.
- // It's not precise but enough.
- start_time_ms: self.start_time_ms,
- },
- );
- }
- Mode::Distributed => {
- if let Some(meta_client) = utils::meta_client(&self.catalog_manager)? {
- let node_infos = meta_client
- .list_nodes(None)
- .await
- .map_err(BoxedError::new)
- .context(ListNodesSnafu)?;
-
- for node_info in node_infos {
- self.add_node_info(&predicates, node_info);
- }
- } else {
- warn!("Could not find meta client in distributed mode.");
- }
- }
+ let information_extension = utils::information_extension(&self.catalog_manager)?;
+ let node_infos = information_extension.nodes().await?;
+ for node_info in node_infos {
+ self.add_node_info(&predicates, node_info);
}
-
self.finish()
}
diff --git a/src/catalog/src/system_schema/information_schema/procedure_info.rs b/src/catalog/src/system_schema/information_schema/procedure_info.rs
new file mode 100644
index 0000000000..6e3c0b1f46
--- /dev/null
+++ b/src/catalog/src/system_schema/information_schema/procedure_info.rs
@@ -0,0 +1,241 @@
+// Copyright 2023 Greptime Team
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+use std::sync::{Arc, Weak};
+
+use arrow_schema::SchemaRef as ArrowSchemaRef;
+use common_catalog::consts::INFORMATION_SCHEMA_PROCEDURE_INFO_TABLE_ID;
+use common_error::ext::BoxedError;
+use common_procedure::ProcedureInfo;
+use common_recordbatch::adapter::RecordBatchStreamAdapter;
+use common_recordbatch::{RecordBatch, SendableRecordBatchStream};
+use common_time::timestamp::Timestamp;
+use datafusion::execution::TaskContext;
+use datafusion::physical_plan::stream::RecordBatchStreamAdapter as DfRecordBatchStreamAdapter;
+use datafusion::physical_plan::streaming::PartitionStream as DfPartitionStream;
+use datafusion::physical_plan::SendableRecordBatchStream as DfSendableRecordBatchStream;
+use datatypes::prelude::{ConcreteDataType, ScalarVectorBuilder, VectorRef};
+use datatypes::schema::{ColumnSchema, Schema, SchemaRef};
+use datatypes::timestamp::TimestampMillisecond;
+use datatypes::value::Value;
+use datatypes::vectors::{StringVectorBuilder, TimestampMillisecondVectorBuilder};
+use snafu::ResultExt;
+use store_api::storage::{ScanRequest, TableId};
+
+use super::PROCEDURE_INFO;
+use crate::error::{CreateRecordBatchSnafu, InternalSnafu, Result};
+use crate::system_schema::information_schema::{InformationTable, Predicates};
+use crate::system_schema::utils;
+use crate::CatalogManager;
+
+const PROCEDURE_ID: &str = "procedure_id";
+const PROCEDURE_TYPE: &str = "procedure_type";
+const START_TIME: &str = "start_time";
+const END_TIME: &str = "end_time";
+const STATUS: &str = "status";
+const LOCK_KEYS: &str = "lock_keys";
+
+const INIT_CAPACITY: usize = 42;
+
+/// The `PROCEDURE_INFO` table provides information about the current procedure information of the cluster.
+///
+/// - `procedure_id`: the unique identifier of the procedure.
+/// - `procedure_name`: the name of the procedure.
+/// - `start_time`: the starting execution time of the procedure.
+/// - `end_time`: the ending execution time of the procedure.
+/// - `status`: the status of the procedure.
+/// - `lock_keys`: the lock keys of the procedure.
+///
+pub(super) struct InformationSchemaProcedureInfo {
+ schema: SchemaRef,
+ catalog_manager: Weak,
+}
+
+impl InformationSchemaProcedureInfo {
+ pub(super) fn new(catalog_manager: Weak) -> Self {
+ Self {
+ schema: Self::schema(),
+ catalog_manager,
+ }
+ }
+
+ pub(crate) fn schema() -> SchemaRef {
+ Arc::new(Schema::new(vec![
+ ColumnSchema::new(PROCEDURE_ID, ConcreteDataType::string_datatype(), false),
+ ColumnSchema::new(PROCEDURE_TYPE, ConcreteDataType::string_datatype(), false),
+ ColumnSchema::new(
+ START_TIME,
+ ConcreteDataType::timestamp_millisecond_datatype(),
+ true,
+ ),
+ ColumnSchema::new(
+ END_TIME,
+ ConcreteDataType::timestamp_millisecond_datatype(),
+ true,
+ ),
+ ColumnSchema::new(STATUS, ConcreteDataType::string_datatype(), false),
+ ColumnSchema::new(LOCK_KEYS, ConcreteDataType::string_datatype(), true),
+ ]))
+ }
+
+ fn builder(&self) -> InformationSchemaProcedureInfoBuilder {
+ InformationSchemaProcedureInfoBuilder::new(
+ self.schema.clone(),
+ self.catalog_manager.clone(),
+ )
+ }
+}
+
+impl InformationTable for InformationSchemaProcedureInfo {
+ fn table_id(&self) -> TableId {
+ INFORMATION_SCHEMA_PROCEDURE_INFO_TABLE_ID
+ }
+
+ fn table_name(&self) -> &'static str {
+ PROCEDURE_INFO
+ }
+
+ fn schema(&self) -> SchemaRef {
+ self.schema.clone()
+ }
+
+ fn to_stream(&self, request: ScanRequest) -> Result {
+ let schema = self.schema.arrow_schema().clone();
+ let mut builder = self.builder();
+ let stream = Box::pin(DfRecordBatchStreamAdapter::new(
+ schema,
+ futures::stream::once(async move {
+ builder
+ .make_procedure_info(Some(request))
+ .await
+ .map(|x| x.into_df_record_batch())
+ .map_err(Into::into)
+ }),
+ ));
+ Ok(Box::pin(
+ RecordBatchStreamAdapter::try_new(stream)
+ .map_err(BoxedError::new)
+ .context(InternalSnafu)?,
+ ))
+ }
+}
+
+struct InformationSchemaProcedureInfoBuilder {
+ schema: SchemaRef,
+ catalog_manager: Weak,
+
+ procedure_ids: StringVectorBuilder,
+ procedure_types: StringVectorBuilder,
+ start_times: TimestampMillisecondVectorBuilder,
+ end_times: TimestampMillisecondVectorBuilder,
+ statuses: StringVectorBuilder,
+ lock_keys: StringVectorBuilder,
+}
+
+impl InformationSchemaProcedureInfoBuilder {
+ fn new(schema: SchemaRef, catalog_manager: Weak) -> Self {
+ Self {
+ schema,
+ catalog_manager,
+ procedure_ids: StringVectorBuilder::with_capacity(INIT_CAPACITY),
+ procedure_types: StringVectorBuilder::with_capacity(INIT_CAPACITY),
+ start_times: TimestampMillisecondVectorBuilder::with_capacity(INIT_CAPACITY),
+ end_times: TimestampMillisecondVectorBuilder::with_capacity(INIT_CAPACITY),
+ statuses: StringVectorBuilder::with_capacity(INIT_CAPACITY),
+ lock_keys: StringVectorBuilder::with_capacity(INIT_CAPACITY),
+ }
+ }
+
+ /// Construct the `information_schema.procedure_info` virtual table
+ async fn make_procedure_info(&mut self, request: Option) -> Result {
+ let predicates = Predicates::from_scan_request(&request);
+ let information_extension = utils::information_extension(&self.catalog_manager)?;
+ let procedures = information_extension.procedures().await?;
+ for (status, procedure_info) in procedures {
+ self.add_procedure(&predicates, status, procedure_info);
+ }
+ self.finish()
+ }
+
+ fn add_procedure(
+ &mut self,
+ predicates: &Predicates,
+ status: String,
+ procedure_info: ProcedureInfo,
+ ) {
+ let ProcedureInfo {
+ id,
+ type_name,
+ start_time_ms,
+ end_time_ms,
+ lock_keys,
+ ..
+ } = procedure_info;
+ let pid = id.to_string();
+ let start_time = TimestampMillisecond(Timestamp::new_millisecond(start_time_ms));
+ let end_time = TimestampMillisecond(Timestamp::new_millisecond(end_time_ms));
+ let lock_keys = lock_keys.join(",");
+
+ let row = [
+ (PROCEDURE_ID, &Value::from(pid.clone())),
+ (PROCEDURE_TYPE, &Value::from(type_name.clone())),
+ (START_TIME, &Value::from(start_time)),
+ (END_TIME, &Value::from(end_time)),
+ (STATUS, &Value::from(status.clone())),
+ (LOCK_KEYS, &Value::from(lock_keys.clone())),
+ ];
+ if !predicates.eval(&row) {
+ return;
+ }
+ self.procedure_ids.push(Some(&pid));
+ self.procedure_types.push(Some(&type_name));
+ self.start_times.push(Some(start_time));
+ self.end_times.push(Some(end_time));
+ self.statuses.push(Some(&status));
+ self.lock_keys.push(Some(&lock_keys));
+ }
+
+ fn finish(&mut self) -> Result {
+ let columns: Vec = vec![
+ Arc::new(self.procedure_ids.finish()),
+ Arc::new(self.procedure_types.finish()),
+ Arc::new(self.start_times.finish()),
+ Arc::new(self.end_times.finish()),
+ Arc::new(self.statuses.finish()),
+ Arc::new(self.lock_keys.finish()),
+ ];
+ RecordBatch::new(self.schema.clone(), columns).context(CreateRecordBatchSnafu)
+ }
+}
+
+impl DfPartitionStream for InformationSchemaProcedureInfo {
+ fn schema(&self) -> &ArrowSchemaRef {
+ self.schema.arrow_schema()
+ }
+
+ fn execute(&self, _: Arc) -> DfSendableRecordBatchStream {
+ let schema = self.schema.arrow_schema().clone();
+ let mut builder = self.builder();
+ Box::pin(DfRecordBatchStreamAdapter::new(
+ schema,
+ futures::stream::once(async move {
+ builder
+ .make_procedure_info(None)
+ .await
+ .map(|x| x.into_df_record_batch())
+ .map_err(Into::into)
+ }),
+ ))
+ }
+}
diff --git a/src/catalog/src/system_schema/information_schema/region_peers.rs b/src/catalog/src/system_schema/information_schema/region_peers.rs
index 5496879af0..50c2593f86 100644
--- a/src/catalog/src/system_schema/information_schema/region_peers.rs
+++ b/src/catalog/src/system_schema/information_schema/region_peers.rs
@@ -224,8 +224,8 @@ impl InformationSchemaRegionPeersBuilder {
let region_id = RegionId::new(table_id, route.region.id.region_number()).as_u64();
let peer_id = route.leader_peer.clone().map(|p| p.id);
let peer_addr = route.leader_peer.clone().map(|p| p.addr);
- let status = if let Some(status) = route.leader_status {
- Some(status.as_ref().to_string())
+ let state = if let Some(state) = route.leader_state {
+ Some(state.as_ref().to_string())
} else {
// Alive by default
Some("ALIVE".to_string())
@@ -242,7 +242,7 @@ impl InformationSchemaRegionPeersBuilder {
self.peer_ids.push(peer_id);
self.peer_addrs.push(peer_addr.as_deref());
self.is_leaders.push(Some("Yes"));
- self.statuses.push(status.as_deref());
+ self.statuses.push(state.as_deref());
self.down_seconds
.push(route.leader_down_millis().map(|m| m / 1000));
}
diff --git a/src/catalog/src/system_schema/information_schema/region_statistics.rs b/src/catalog/src/system_schema/information_schema/region_statistics.rs
new file mode 100644
index 0000000000..a98a70cb23
--- /dev/null
+++ b/src/catalog/src/system_schema/information_schema/region_statistics.rs
@@ -0,0 +1,261 @@
+// Copyright 2023 Greptime Team
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+use std::sync::{Arc, Weak};
+
+use arrow_schema::SchemaRef as ArrowSchemaRef;
+use common_catalog::consts::INFORMATION_SCHEMA_REGION_STATISTICS_TABLE_ID;
+use common_error::ext::BoxedError;
+use common_meta::datanode::RegionStat;
+use common_recordbatch::adapter::RecordBatchStreamAdapter;
+use common_recordbatch::{DfSendableRecordBatchStream, RecordBatch, SendableRecordBatchStream};
+use datafusion::execution::TaskContext;
+use datafusion::physical_plan::stream::RecordBatchStreamAdapter as DfRecordBatchStreamAdapter;
+use datafusion::physical_plan::streaming::PartitionStream as DfPartitionStream;
+use datatypes::prelude::{ConcreteDataType, ScalarVectorBuilder, VectorRef};
+use datatypes::schema::{ColumnSchema, Schema, SchemaRef};
+use datatypes::value::Value;
+use datatypes::vectors::{StringVectorBuilder, UInt32VectorBuilder, UInt64VectorBuilder};
+use snafu::ResultExt;
+use store_api::storage::{ScanRequest, TableId};
+
+use super::{InformationTable, REGION_STATISTICS};
+use crate::error::{CreateRecordBatchSnafu, InternalSnafu, Result};
+use crate::information_schema::Predicates;
+use crate::system_schema::utils;
+use crate::CatalogManager;
+
+const REGION_ID: &str = "region_id";
+const TABLE_ID: &str = "table_id";
+const REGION_NUMBER: &str = "region_number";
+const REGION_ROWS: &str = "region_rows";
+const DISK_SIZE: &str = "disk_size";
+const MEMTABLE_SIZE: &str = "memtable_size";
+const MANIFEST_SIZE: &str = "manifest_size";
+const SST_SIZE: &str = "sst_size";
+const INDEX_SIZE: &str = "index_size";
+const ENGINE: &str = "engine";
+const REGION_ROLE: &str = "region_role";
+
+const INIT_CAPACITY: usize = 42;
+
+/// The `REGION_STATISTICS` table provides information about the region statistics. Including fields:
+///
+/// - `region_id`: The region id.
+/// - `table_id`: The table id.
+/// - `region_number`: The region number.
+/// - `region_rows`: The number of rows in region.
+/// - `memtable_size`: The memtable size in bytes.
+/// - `disk_size`: The approximate disk size in bytes.
+/// - `manifest_size`: The manifest size in bytes.
+/// - `sst_size`: The sst data files size in bytes.
+/// - `index_size`: The sst index files size in bytes.
+/// - `engine`: The engine type.
+/// - `region_role`: The region role.
+///
+pub(super) struct InformationSchemaRegionStatistics {
+ schema: SchemaRef,
+ catalog_manager: Weak,
+}
+
+impl InformationSchemaRegionStatistics {
+ pub(super) fn new(catalog_manager: Weak) -> Self {
+ Self {
+ schema: Self::schema(),
+ catalog_manager,
+ }
+ }
+
+ pub(crate) fn schema() -> SchemaRef {
+ Arc::new(Schema::new(vec![
+ ColumnSchema::new(REGION_ID, ConcreteDataType::uint64_datatype(), false),
+ ColumnSchema::new(TABLE_ID, ConcreteDataType::uint32_datatype(), false),
+ ColumnSchema::new(REGION_NUMBER, ConcreteDataType::uint32_datatype(), false),
+ ColumnSchema::new(REGION_ROWS, ConcreteDataType::uint64_datatype(), true),
+ ColumnSchema::new(DISK_SIZE, ConcreteDataType::uint64_datatype(), true),
+ ColumnSchema::new(MEMTABLE_SIZE, ConcreteDataType::uint64_datatype(), true),
+ ColumnSchema::new(MANIFEST_SIZE, ConcreteDataType::uint64_datatype(), true),
+ ColumnSchema::new(SST_SIZE, ConcreteDataType::uint64_datatype(), true),
+ ColumnSchema::new(INDEX_SIZE, ConcreteDataType::uint64_datatype(), true),
+ ColumnSchema::new(ENGINE, ConcreteDataType::string_datatype(), true),
+ ColumnSchema::new(REGION_ROLE, ConcreteDataType::string_datatype(), true),
+ ]))
+ }
+
+ fn builder(&self) -> InformationSchemaRegionStatisticsBuilder {
+ InformationSchemaRegionStatisticsBuilder::new(
+ self.schema.clone(),
+ self.catalog_manager.clone(),
+ )
+ }
+}
+
+impl InformationTable for InformationSchemaRegionStatistics {
+ fn table_id(&self) -> TableId {
+ INFORMATION_SCHEMA_REGION_STATISTICS_TABLE_ID
+ }
+
+ fn table_name(&self) -> &'static str {
+ REGION_STATISTICS
+ }
+
+ fn schema(&self) -> SchemaRef {
+ self.schema.clone()
+ }
+
+ fn to_stream(&self, request: ScanRequest) -> Result {
+ let schema = self.schema.arrow_schema().clone();
+ let mut builder = self.builder();
+
+ let stream = Box::pin(DfRecordBatchStreamAdapter::new(
+ schema,
+ futures::stream::once(async move {
+ builder
+ .make_region_statistics(Some(request))
+ .await
+ .map(|x| x.into_df_record_batch())
+ .map_err(Into::into)
+ }),
+ ));
+
+ Ok(Box::pin(
+ RecordBatchStreamAdapter::try_new(stream)
+ .map_err(BoxedError::new)
+ .context(InternalSnafu)?,
+ ))
+ }
+}
+
+struct InformationSchemaRegionStatisticsBuilder {
+ schema: SchemaRef,
+ catalog_manager: Weak,
+
+ region_ids: UInt64VectorBuilder,
+ table_ids: UInt32VectorBuilder,
+ region_numbers: UInt32VectorBuilder,
+ region_rows: UInt64VectorBuilder,
+ disk_sizes: UInt64VectorBuilder,
+ memtable_sizes: UInt64VectorBuilder,
+ manifest_sizes: UInt64VectorBuilder,
+ sst_sizes: UInt64VectorBuilder,
+ index_sizes: UInt64VectorBuilder,
+ engines: StringVectorBuilder,
+ region_roles: StringVectorBuilder,
+}
+
+impl InformationSchemaRegionStatisticsBuilder {
+ fn new(schema: SchemaRef, catalog_manager: Weak) -> Self {
+ Self {
+ schema,
+ catalog_manager,
+ region_ids: UInt64VectorBuilder::with_capacity(INIT_CAPACITY),
+ table_ids: UInt32VectorBuilder::with_capacity(INIT_CAPACITY),
+ region_numbers: UInt32VectorBuilder::with_capacity(INIT_CAPACITY),
+ region_rows: UInt64VectorBuilder::with_capacity(INIT_CAPACITY),
+ disk_sizes: UInt64VectorBuilder::with_capacity(INIT_CAPACITY),
+ memtable_sizes: UInt64VectorBuilder::with_capacity(INIT_CAPACITY),
+ manifest_sizes: UInt64VectorBuilder::with_capacity(INIT_CAPACITY),
+ sst_sizes: UInt64VectorBuilder::with_capacity(INIT_CAPACITY),
+ index_sizes: UInt64VectorBuilder::with_capacity(INIT_CAPACITY),
+ engines: StringVectorBuilder::with_capacity(INIT_CAPACITY),
+ region_roles: StringVectorBuilder::with_capacity(INIT_CAPACITY),
+ }
+ }
+
+ /// Construct a new `InformationSchemaRegionStatistics` from the collected data.
+ async fn make_region_statistics(
+ &mut self,
+ request: Option,
+ ) -> Result {
+ let predicates = Predicates::from_scan_request(&request);
+ let information_extension = utils::information_extension(&self.catalog_manager)?;
+ let region_stats = information_extension.region_stats().await?;
+ for region_stat in region_stats {
+ self.add_region_statistic(&predicates, region_stat);
+ }
+ self.finish()
+ }
+
+ fn add_region_statistic(&mut self, predicate: &Predicates, region_stat: RegionStat) {
+ let row = [
+ (REGION_ID, &Value::from(region_stat.id.as_u64())),
+ (TABLE_ID, &Value::from(region_stat.id.table_id())),
+ (REGION_NUMBER, &Value::from(region_stat.id.region_number())),
+ (REGION_ROWS, &Value::from(region_stat.num_rows)),
+ (DISK_SIZE, &Value::from(region_stat.approximate_bytes)),
+ (MEMTABLE_SIZE, &Value::from(region_stat.memtable_size)),
+ (MANIFEST_SIZE, &Value::from(region_stat.manifest_size)),
+ (SST_SIZE, &Value::from(region_stat.sst_size)),
+ (INDEX_SIZE, &Value::from(region_stat.index_size)),
+ (ENGINE, &Value::from(region_stat.engine.as_str())),
+ (REGION_ROLE, &Value::from(region_stat.role.to_string())),
+ ];
+
+ if !predicate.eval(&row) {
+ return;
+ }
+
+ self.region_ids.push(Some(region_stat.id.as_u64()));
+ self.table_ids.push(Some(region_stat.id.table_id()));
+ self.region_numbers
+ .push(Some(region_stat.id.region_number()));
+ self.region_rows.push(Some(region_stat.num_rows));
+ self.disk_sizes.push(Some(region_stat.approximate_bytes));
+ self.memtable_sizes.push(Some(region_stat.memtable_size));
+ self.manifest_sizes.push(Some(region_stat.manifest_size));
+ self.sst_sizes.push(Some(region_stat.sst_size));
+ self.index_sizes.push(Some(region_stat.index_size));
+ self.engines.push(Some(®ion_stat.engine));
+ self.region_roles.push(Some(®ion_stat.role.to_string()));
+ }
+
+ fn finish(&mut self) -> Result {
+ let columns: Vec = vec![
+ Arc::new(self.region_ids.finish()),
+ Arc::new(self.table_ids.finish()),
+ Arc::new(self.region_numbers.finish()),
+ Arc::new(self.region_rows.finish()),
+ Arc::new(self.disk_sizes.finish()),
+ Arc::new(self.memtable_sizes.finish()),
+ Arc::new(self.manifest_sizes.finish()),
+ Arc::new(self.sst_sizes.finish()),
+ Arc::new(self.index_sizes.finish()),
+ Arc::new(self.engines.finish()),
+ Arc::new(self.region_roles.finish()),
+ ];
+
+ RecordBatch::new(self.schema.clone(), columns).context(CreateRecordBatchSnafu)
+ }
+}
+
+impl DfPartitionStream for InformationSchemaRegionStatistics {
+ fn schema(&self) -> &ArrowSchemaRef {
+ self.schema.arrow_schema()
+ }
+
+ fn execute(&self, _: Arc) -> DfSendableRecordBatchStream {
+ let schema = self.schema.arrow_schema().clone();
+ let mut builder = self.builder();
+ Box::pin(DfRecordBatchStreamAdapter::new(
+ schema,
+ futures::stream::once(async move {
+ builder
+ .make_region_statistics(None)
+ .await
+ .map(|x| x.into_df_record_batch())
+ .map_err(Into::into)
+ }),
+ ))
+ }
+}
diff --git a/src/catalog/src/system_schema/information_schema/table_names.rs b/src/catalog/src/system_schema/information_schema/table_names.rs
index c2c9eeff24..cdff5ebb77 100644
--- a/src/catalog/src/system_schema/information_schema/table_names.rs
+++ b/src/catalog/src/system_schema/information_schema/table_names.rs
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-/// All table names in `information_schema`.
+//! All table names in `information_schema`.
pub const TABLES: &str = "tables";
pub const COLUMNS: &str = "columns";
@@ -45,3 +45,5 @@ pub const TABLE_CONSTRAINTS: &str = "table_constraints";
pub const CLUSTER_INFO: &str = "cluster_info";
pub const VIEWS: &str = "views";
pub const FLOWS: &str = "flows";
+pub const PROCEDURE_INFO: &str = "procedure_info";
+pub const REGION_STATISTICS: &str = "region_statistics";
diff --git a/src/catalog/src/system_schema/memory_table.rs b/src/catalog/src/system_schema/memory_table.rs
index dd026010bb..f5c675832e 100644
--- a/src/catalog/src/system_schema/memory_table.rs
+++ b/src/catalog/src/system_schema/memory_table.rs
@@ -74,7 +74,7 @@ impl MemoryTableBuilder {
/// Construct the `information_schema.{table_name}` virtual table
pub async fn memory_records(&mut self) -> Result {
if self.columns.is_empty() {
- RecordBatch::new_empty(self.schema.clone()).context(CreateRecordBatchSnafu)
+ Ok(RecordBatch::new_empty(self.schema.clone()))
} else {
RecordBatch::new(self.schema.clone(), std::mem::take(&mut self.columns))
.context(CreateRecordBatchSnafu)
diff --git a/src/catalog/src/system_schema/pg_catalog/pg_namespace.rs b/src/catalog/src/system_schema/pg_catalog/pg_namespace.rs
index c6db980de7..108cd92242 100644
--- a/src/catalog/src/system_schema/pg_catalog/pg_namespace.rs
+++ b/src/catalog/src/system_schema/pg_catalog/pg_namespace.rs
@@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//! The `pg_catalog.pg_namespace` table implementation.
+//! namespace is a schema in greptime
+
pub(super) mod oid_map;
use std::sync::{Arc, Weak};
@@ -40,9 +43,6 @@ use crate::system_schema::utils::tables::{string_column, u32_column};
use crate::system_schema::SystemTable;
use crate::CatalogManager;
-/// The `pg_catalog.pg_namespace` table implementation.
-/// namespace is a schema in greptime
-
const NSPNAME: &str = "nspname";
const INIT_CAPACITY: usize = 42;
diff --git a/src/catalog/src/system_schema/utils.rs b/src/catalog/src/system_schema/utils.rs
index 2a2e89516a..8d8af84bf0 100644
--- a/src/catalog/src/system_schema/utils.rs
+++ b/src/catalog/src/system_schema/utils.rs
@@ -12,47 +12,33 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-pub mod tables;
+use std::sync::Weak;
-use std::sync::{Arc, Weak};
-
-use common_config::Mode;
use common_meta::key::TableMetadataManagerRef;
-use meta_client::client::MetaClient;
use snafu::OptionExt;
-use crate::error::{Result, UpgradeWeakCatalogManagerRefSnafu};
+use crate::error::{GetInformationExtensionSnafu, Result, UpgradeWeakCatalogManagerRefSnafu};
+use crate::information_schema::InformationExtensionRef;
use crate::kvbackend::KvBackendCatalogManager;
use crate::CatalogManager;
-/// Try to get the server running mode from `[CatalogManager]` weak reference.
-pub fn running_mode(catalog_manager: &Weak) -> Result> {
+pub mod tables;
+
+/// Try to get the `[InformationExtension]` from `[CatalogManager]` weak reference.
+pub fn information_extension(
+ catalog_manager: &Weak,
+) -> Result {
let catalog_manager = catalog_manager
.upgrade()
.context(UpgradeWeakCatalogManagerRefSnafu)?;
- Ok(catalog_manager
+ let information_extension = catalog_manager
.as_any()
.downcast_ref::()
- .map(|manager| manager.running_mode())
- .copied())
-}
+ .map(|manager| manager.information_extension())
+ .context(GetInformationExtensionSnafu)?;
-/// Try to get the `[MetaClient]` from `[CatalogManager]` weak reference.
-pub fn meta_client(catalog_manager: &Weak) -> Result>> {
- let catalog_manager = catalog_manager
- .upgrade()
- .context(UpgradeWeakCatalogManagerRefSnafu)?;
-
- let meta_client = match catalog_manager
- .as_any()
- .downcast_ref::()
- {
- None => None,
- Some(manager) => manager.meta_client(),
- };
-
- Ok(meta_client)
+ Ok(information_extension)
}
/// Try to get the `[TableMetadataManagerRef]` from `[CatalogManager]` weak reference.
diff --git a/src/catalog/src/table_source.rs b/src/catalog/src/table_source.rs
index d6d81fa134..ca9c5b89d3 100644
--- a/src/catalog/src/table_source.rs
+++ b/src/catalog/src/table_source.rs
@@ -259,7 +259,6 @@ mod tests {
use arrow::datatypes::{DataType, Field, Schema, SchemaRef};
use cache::{build_fundamental_cache_registry, with_default_composite_cache_registry};
- use common_config::Mode;
use common_meta::cache::{CacheRegistryBuilder, LayeredCacheRegistryBuilder};
use common_meta::key::TableMetadataManager;
use common_meta::kv_backend::memory::MemoryKvBackend;
@@ -269,6 +268,8 @@ mod tests {
use datafusion::logical_expr::builder::LogicalTableSource;
use datafusion::logical_expr::{col, lit, LogicalPlan, LogicalPlanBuilder};
+ use crate::information_schema::NoopInformationExtension;
+
struct MockDecoder;
impl MockDecoder {
pub fn arc() -> Arc {
@@ -323,10 +324,10 @@ mod tests {
);
let catalog_manager = KvBackendCatalogManager::new(
- Mode::Standalone,
- None,
+ Arc::new(NoopInformationExtension),
backend.clone(),
layered_cache_registry,
+ None,
);
let table_metadata_manager = TableMetadataManager::new(backend);
let mut view_info = common_meta::key::test_utils::new_test_table_info(1024, vec![]);
diff --git a/src/client/Cargo.toml b/src/client/Cargo.toml
index 469d7d1a7e..9d198ab9fb 100644
--- a/src/client/Cargo.toml
+++ b/src/client/Cargo.toml
@@ -28,7 +28,7 @@ enum_dispatch = "0.3"
futures-util.workspace = true
lazy_static.workspace = true
moka = { workspace = true, features = ["future"] }
-parking_lot = "0.12"
+parking_lot.workspace = true
prometheus.workspace = true
prost.workspace = true
query.workspace = true
@@ -45,7 +45,6 @@ common-grpc-expr.workspace = true
datanode.workspace = true
derive-new = "0.5"
tracing = "0.1"
-tracing-subscriber = { version = "0.3", features = ["env-filter"] }
[dev-dependencies.substrait_proto]
package = "substrait"
diff --git a/src/cmd/Cargo.toml b/src/cmd/Cargo.toml
index 71841aabec..6309d64294 100644
--- a/src/cmd/Cargo.toml
+++ b/src/cmd/Cargo.toml
@@ -10,7 +10,7 @@ name = "greptime"
path = "src/bin/greptime.rs"
[features]
-default = ["python"]
+default = ["python", "servers/pprof", "servers/mem-prof"]
tokio-console = ["common-telemetry/tokio-console"]
python = ["frontend/python"]
@@ -70,6 +70,7 @@ serde.workspace = true
serde_json.workspace = true
servers.workspace = true
session.workspace = true
+similar-asserts.workspace = true
snafu.workspace = true
store-api.workspace = true
substrait.workspace = true
@@ -77,7 +78,7 @@ table.workspace = true
tokio.workspace = true
toml.workspace = true
tonic.workspace = true
-tracing-appender = "0.2"
+tracing-appender.workspace = true
[target.'cfg(not(windows))'.dependencies]
tikv-jemallocator = "0.6"
diff --git a/src/cmd/src/bin/greptime.rs b/src/cmd/src/bin/greptime.rs
index f36d0f1331..54659833fa 100644
--- a/src/cmd/src/bin/greptime.rs
+++ b/src/cmd/src/bin/greptime.rs
@@ -15,10 +15,11 @@
#![doc = include_str!("../../../../README.md")]
use clap::{Parser, Subcommand};
-use cmd::error::Result;
+use cmd::error::{InitTlsProviderSnafu, Result};
use cmd::options::GlobalOptions;
use cmd::{cli, datanode, flownode, frontend, metasrv, standalone, App};
use common_version::version;
+use servers::install_ring_crypto_provider;
#[derive(Parser)]
#[command(name = "greptime", author, version, long_version = version(), about)]
@@ -94,6 +95,7 @@ async fn main() -> Result<()> {
async fn main_body() -> Result<()> {
setup_human_panic();
+ install_ring_crypto_provider().map_err(|msg| InitTlsProviderSnafu { msg }.build())?;
start(Command::parse()).await
}
diff --git a/src/cmd/src/cli/bench.rs b/src/cmd/src/cli/bench.rs
index bf5a6825f0..f3d1d0f809 100644
--- a/src/cmd/src/cli/bench.rs
+++ b/src/cmd/src/cli/bench.rs
@@ -158,7 +158,7 @@ fn create_region_routes(regions: Vec) -> Vec {
addr: String::new(),
}),
follower_peers: vec![],
- leader_status: None,
+ leader_state: None,
leader_down_since: None,
});
}
diff --git a/src/cmd/src/cli/repl.rs b/src/cmd/src/cli/repl.rs
index 6d7e211d7c..0f8e5b0450 100644
--- a/src/cmd/src/cli/repl.rs
+++ b/src/cmd/src/cli/repl.rs
@@ -35,7 +35,6 @@ use either::Either;
use meta_client::client::MetaClientBuilder;
use query::datafusion::DatafusionQueryEngine;
use query::parser::QueryLanguageParser;
-use query::plan::LogicalPlan;
use query::query_engine::{DefaultSerializer, QueryEngineState};
use query::QueryEngine;
use rustyline::error::ReadlineError;
@@ -47,12 +46,12 @@ use substrait::{DFLogicalSubstraitConvertor, SubstraitPlan};
use crate::cli::cmd::ReplCommand;
use crate::cli::helper::RustylineHelper;
use crate::cli::AttachCommand;
-use crate::error;
use crate::error::{
CollectRecordBatchesSnafu, ParseSqlSnafu, PlanStatementSnafu, PrettyPrintRecordBatchesSnafu,
ReadlineSnafu, ReplCreationSnafu, RequestDatabaseSnafu, Result, StartMetaClientSnafu,
SubstraitEncodeLogicalPlanSnafu,
};
+use crate::{error, DistributedInformationExtension};
/// Captures the state of the repl, gathers commands and executes them one by one
pub struct Repl {
@@ -175,11 +174,11 @@ impl Repl {
let plan = query_engine
.planner()
- .plan(stmt, query_ctx.clone())
+ .plan(&stmt, query_ctx.clone())
.await
.context(PlanStatementSnafu)?;
- let LogicalPlan::DfPlan(plan) = query_engine
+ let plan = query_engine
.optimize(&query_engine.engine_context(query_ctx), &plan)
.context(PlanStatementSnafu)?;
@@ -276,11 +275,12 @@ async fn create_query_engine(meta_addr: &str) -> Result {
.build(),
);
+ let information_extension = Arc::new(DistributedInformationExtension::new(meta_client.clone()));
let catalog_manager = KvBackendCatalogManager::new(
- Mode::Distributed,
- Some(meta_client.clone()),
+ information_extension,
cached_meta_backend.clone(),
layered_cache_registry,
+ None,
);
let plugins: Plugins = Default::default();
let state = Arc::new(QueryEngineState::new(
diff --git a/src/cmd/src/datanode.rs b/src/cmd/src/datanode.rs
index 466514d038..187bdbd7aa 100644
--- a/src/cmd/src/datanode.rs
+++ b/src/cmd/src/datanode.rs
@@ -272,9 +272,10 @@ impl StartCommand {
info!("Datanode start command: {:#?}", self);
info!("Datanode options: {:#?}", opts);
+ let plugin_opts = opts.plugins;
let opts = opts.component;
let mut plugins = Plugins::new();
- plugins::setup_datanode_plugins(&mut plugins, &opts)
+ plugins::setup_datanode_plugins(&mut plugins, &plugin_opts, &opts)
.await
.context(StartDatanodeSnafu)?;
diff --git a/src/cmd/src/error.rs b/src/cmd/src/error.rs
index 08c81c414c..f042b48478 100644
--- a/src/cmd/src/error.rs
+++ b/src/cmd/src/error.rs
@@ -24,6 +24,12 @@ use snafu::{Location, Snafu};
#[snafu(visibility(pub))]
#[stack_trace_debug]
pub enum Error {
+ #[snafu(display("Failed to install ring crypto provider: {}", msg))]
+ InitTlsProvider {
+ #[snafu(implicit)]
+ location: Location,
+ msg: String,
+ },
#[snafu(display("Failed to create default catalog and schema"))]
InitMetadata {
#[snafu(implicit)]
@@ -369,9 +375,10 @@ impl ErrorExt for Error {
}
Error::SubstraitEncodeLogicalPlan { source, .. } => source.status_code(),
- Error::SerdeJson { .. } | Error::FileIo { .. } | Error::SpawnThread { .. } => {
- StatusCode::Unexpected
- }
+ Error::SerdeJson { .. }
+ | Error::FileIo { .. }
+ | Error::SpawnThread { .. }
+ | Error::InitTlsProvider { .. } => StatusCode::Unexpected,
Error::Other { source, .. } => source.status_code(),
diff --git a/src/cmd/src/flownode.rs b/src/cmd/src/flownode.rs
index e950d9bb43..d2a8454085 100644
--- a/src/cmd/src/flownode.rs
+++ b/src/cmd/src/flownode.rs
@@ -41,7 +41,7 @@ use crate::error::{
MissingConfigSnafu, Result, ShutdownFlownodeSnafu, StartFlownodeSnafu,
};
use crate::options::{GlobalOptions, GreptimeOptions};
-use crate::{log_versions, App};
+use crate::{log_versions, App, DistributedInformationExtension};
pub const APP_NAME: &str = "greptime-flownode";
@@ -269,11 +269,13 @@ impl StartCommand {
.build(),
);
+ let information_extension =
+ Arc::new(DistributedInformationExtension::new(meta_client.clone()));
let catalog_manager = KvBackendCatalogManager::new(
- opts.mode,
- Some(meta_client.clone()),
+ information_extension,
cached_meta_backend.clone(),
layered_cache_registry.clone(),
+ None,
);
let table_metadata_manager =
diff --git a/src/cmd/src/frontend.rs b/src/cmd/src/frontend.rs
index 6d8fd97070..728d584b3c 100644
--- a/src/cmd/src/frontend.rs
+++ b/src/cmd/src/frontend.rs
@@ -36,8 +36,8 @@ use frontend::instance::builder::FrontendBuilder;
use frontend::instance::{FrontendInstance, Instance as FeInstance};
use frontend::server::Services;
use meta_client::{MetaClientOptions, MetaClientType};
+use query::stats::StatementStatistics;
use servers::tls::{TlsMode, TlsOption};
-use servers::Mode;
use snafu::{OptionExt, ResultExt};
use tracing_appender::non_blocking::WorkerGuard;
@@ -46,7 +46,7 @@ use crate::error::{
Result, StartFrontendSnafu,
};
use crate::options::{GlobalOptions, GreptimeOptions};
-use crate::{log_versions, App};
+use crate::{log_versions, App, DistributedInformationExtension};
type FrontendOptions = GreptimeOptions;
@@ -266,9 +266,10 @@ impl StartCommand {
info!("Frontend start command: {:#?}", self);
info!("Frontend options: {:#?}", opts);
+ let plugin_opts = opts.plugins;
let opts = opts.component;
let mut plugins = Plugins::new();
- plugins::setup_frontend_plugins(&mut plugins, &opts)
+ plugins::setup_frontend_plugins(&mut plugins, &plugin_opts, &opts)
.await
.context(StartFrontendSnafu)?;
@@ -315,11 +316,13 @@ impl StartCommand {
.build(),
);
+ let information_extension =
+ Arc::new(DistributedInformationExtension::new(meta_client.clone()));
let catalog_manager = KvBackendCatalogManager::new(
- Mode::Distributed,
- Some(meta_client.clone()),
+ information_extension,
cached_meta_backend.clone(),
layered_cache_registry.clone(),
+ None,
);
let executor = HandlerGroupExecutor::new(vec![
@@ -340,6 +343,8 @@ impl StartCommand {
// Some queries are expected to take long time.
let channel_config = ChannelConfig {
timeout: None,
+ tcp_nodelay: opts.datanode.client.tcp_nodelay,
+ connect_timeout: Some(opts.datanode.client.connect_timeout),
..Default::default()
};
let client = NodeClients::new(channel_config);
@@ -351,6 +356,7 @@ impl StartCommand {
catalog_manager,
Arc::new(client),
meta_client,
+ StatementStatistics::new(opts.logging.slow_query.clone()),
)
.with_plugin(plugins.clone())
.with_local_cache_invalidator(layered_cache_registry)
@@ -469,7 +475,7 @@ mod tests {
};
let mut plugins = Plugins::new();
- plugins::setup_frontend_plugins(&mut plugins, &fe_opts)
+ plugins::setup_frontend_plugins(&mut plugins, &[], &fe_opts)
.await
.unwrap();
diff --git a/src/cmd/src/lib.rs b/src/cmd/src/lib.rs
index 5797ef5a85..731f527daf 100644
--- a/src/cmd/src/lib.rs
+++ b/src/cmd/src/lib.rs
@@ -15,7 +15,17 @@
#![feature(assert_matches, let_chains)]
use async_trait::async_trait;
+use catalog::information_schema::InformationExtension;
+use client::api::v1::meta::ProcedureStatus;
+use common_error::ext::BoxedError;
+use common_meta::cluster::{ClusterInfo, NodeInfo};
+use common_meta::datanode::RegionStat;
+use common_meta::ddl::{ExecutorContext, ProcedureExecutor};
+use common_meta::rpc::procedure;
+use common_procedure::{ProcedureInfo, ProcedureState};
use common_telemetry::{error, info};
+use meta_client::MetaClientRef;
+use snafu::ResultExt;
use crate::error::Result;
@@ -74,6 +84,7 @@ pub trait App: Send {
}
/// Log the versions of the application, and the arguments passed to the cli.
+///
/// `version` should be the same as the output of cli "--version";
/// and the `short_version` is the short version of the codes, often consist of git branch and commit.
pub fn log_versions(version: &str, short_version: &str, app: &str) {
@@ -94,3 +105,69 @@ fn log_env_flags() {
info!("argument: {}", argument);
}
}
+
+pub struct DistributedInformationExtension {
+ meta_client: MetaClientRef,
+}
+
+impl DistributedInformationExtension {
+ pub fn new(meta_client: MetaClientRef) -> Self {
+ Self { meta_client }
+ }
+}
+
+#[async_trait::async_trait]
+impl InformationExtension for DistributedInformationExtension {
+ type Error = catalog::error::Error;
+
+ async fn nodes(&self) -> std::result::Result, Self::Error> {
+ self.meta_client
+ .list_nodes(None)
+ .await
+ .map_err(BoxedError::new)
+ .context(catalog::error::ListNodesSnafu)
+ }
+
+ async fn procedures(&self) -> std::result::Result, Self::Error> {
+ let procedures = self
+ .meta_client
+ .list_procedures(&ExecutorContext::default())
+ .await
+ .map_err(BoxedError::new)
+ .context(catalog::error::ListProceduresSnafu)?
+ .procedures;
+ let mut result = Vec::with_capacity(procedures.len());
+ for procedure in procedures {
+ let pid = match procedure.id {
+ Some(pid) => pid,
+ None => return catalog::error::ProcedureIdNotFoundSnafu {}.fail(),
+ };
+ let pid = procedure::pb_pid_to_pid(&pid)
+ .map_err(BoxedError::new)
+ .context(catalog::error::ConvertProtoDataSnafu)?;
+ let status = ProcedureStatus::try_from(procedure.status)
+ .map(|v| v.as_str_name())
+ .unwrap_or("Unknown")
+ .to_string();
+ let procedure_info = ProcedureInfo {
+ id: pid,
+ type_name: procedure.type_name,
+ start_time_ms: procedure.start_time_ms,
+ end_time_ms: procedure.end_time_ms,
+ state: ProcedureState::Running,
+ lock_keys: procedure.lock_keys,
+ };
+ result.push((status, procedure_info));
+ }
+
+ Ok(result)
+ }
+
+ async fn region_stats(&self) -> std::result::Result, Self::Error> {
+ self.meta_client
+ .list_region_stats()
+ .await
+ .map_err(BoxedError::new)
+ .context(catalog::error::ListRegionStatsSnafu)
+ }
+}
diff --git a/src/cmd/src/metasrv.rs b/src/cmd/src/metasrv.rs
index 2389770f52..b116790367 100644
--- a/src/cmd/src/metasrv.rs
+++ b/src/cmd/src/metasrv.rs
@@ -48,6 +48,10 @@ impl Instance {
_guard: guard,
}
}
+
+ pub fn get_inner(&self) -> &MetasrvInstance {
+ &self.instance
+ }
}
#[async_trait]
@@ -86,6 +90,14 @@ impl Command {
pub fn load_options(&self, global_options: &GlobalOptions) -> Result {
self.subcmd.load_options(global_options)
}
+
+ pub fn config_file(&self) -> &Option {
+ self.subcmd.config_file()
+ }
+
+ pub fn env_prefix(&self) -> &String {
+ self.subcmd.env_prefix()
+ }
}
#[derive(Parser)]
@@ -105,6 +117,18 @@ impl SubCommand {
SubCommand::Start(cmd) => cmd.load_options(global_options),
}
}
+
+ fn config_file(&self) -> &Option {
+ match self {
+ SubCommand::Start(cmd) => &cmd.config_file,
+ }
+ }
+
+ fn env_prefix(&self) -> &String {
+ match self {
+ SubCommand::Start(cmd) => &cmd.env_prefix,
+ }
+ }
}
#[derive(Debug, Default, Parser)]
@@ -249,9 +273,10 @@ impl StartCommand {
info!("Metasrv start command: {:#?}", self);
info!("Metasrv options: {:#?}", opts);
+ let plugin_opts = opts.plugins;
let opts = opts.component;
let mut plugins = Plugins::new();
- plugins::setup_metasrv_plugins(&mut plugins, &opts)
+ plugins::setup_metasrv_plugins(&mut plugins, &plugin_opts, &opts)
.await
.context(StartMetaServerSnafu)?;
diff --git a/src/cmd/src/options.rs b/src/cmd/src/options.rs
index 26ac9203a2..ecff735294 100644
--- a/src/cmd/src/options.rs
+++ b/src/cmd/src/options.rs
@@ -15,6 +15,7 @@
use clap::Parser;
use common_config::Configurable;
use common_runtime::global::RuntimeOptions;
+use plugins::PluginOptions;
use serde::{Deserialize, Serialize};
#[derive(Parser, Default, Debug, Clone)]
@@ -40,6 +41,8 @@ pub struct GlobalOptions {
pub struct GreptimeOptions {
/// The runtime options.
pub runtime: RuntimeOptions,
+ /// The plugin options.
+ pub plugins: Vec,
/// The options of each component (like Datanode or Standalone) of GreptimeDB.
#[serde(flatten)]
diff --git a/src/cmd/src/standalone.rs b/src/cmd/src/standalone.rs
index c8083c5f80..251957dd28 100644
--- a/src/cmd/src/standalone.rs
+++ b/src/cmd/src/standalone.rs
@@ -12,19 +12,24 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+use std::net::SocketAddr;
use std::sync::Arc;
use std::{fs, path};
use async_trait::async_trait;
use cache::{build_fundamental_cache_registry, with_default_composite_cache_registry};
+use catalog::information_schema::InformationExtension;
use catalog::kvbackend::KvBackendCatalogManager;
use clap::Parser;
+use client::api::v1::meta::RegionRole;
use common_base::Plugins;
use common_catalog::consts::{MIN_USER_FLOW_ID, MIN_USER_TABLE_ID};
use common_config::{metadata_store_dir, Configurable, KvBackendConfig};
use common_error::ext::BoxedError;
use common_meta::cache::LayeredCacheRegistryBuilder;
use common_meta::cache_invalidator::CacheInvalidatorRef;
+use common_meta::cluster::{NodeInfo, NodeStatus};
+use common_meta::datanode::RegionStat;
use common_meta::ddl::flow_meta::{FlowMetadataAllocator, FlowMetadataAllocatorRef};
use common_meta::ddl::table_meta::{TableMetadataAllocator, TableMetadataAllocatorRef};
use common_meta::ddl::{DdlContext, NoopRegionFailureDetectorControl, ProcedureExecutorRef};
@@ -33,10 +38,11 @@ use common_meta::key::flow::{FlowMetadataManager, FlowMetadataManagerRef};
use common_meta::key::{TableMetadataManager, TableMetadataManagerRef};
use common_meta::kv_backend::KvBackendRef;
use common_meta::node_manager::NodeManagerRef;
+use common_meta::peer::Peer;
use common_meta::region_keeper::MemoryRegionKeeper;
use common_meta::sequence::SequenceBuilder;
use common_meta::wal_options_allocator::{WalOptionsAllocator, WalOptionsAllocatorRef};
-use common_procedure::ProcedureManagerRef;
+use common_procedure::{ProcedureInfo, ProcedureManagerRef};
use common_telemetry::info;
use common_telemetry::logging::{LoggingOptions, TracingOptions};
use common_time::timezone::set_default_timezone;
@@ -44,6 +50,7 @@ use common_version::{short_version, version};
use common_wal::config::DatanodeWalConfig;
use datanode::config::{DatanodeOptions, ProcedureConfig, RegionEngineConfig, StorageConfig};
use datanode::datanode::{Datanode, DatanodeBuilder};
+use datanode::region_server::RegionServer;
use file_engine::config::EngineConfig as FileEngineConfig;
use flow::{FlowWorkerManager, FlownodeBuilder, FrontendInvoker};
use frontend::frontend::FrontendOptions;
@@ -55,6 +62,7 @@ use frontend::service_config::{
};
use meta_srv::metasrv::{FLOW_ID_SEQ, TABLE_ID_SEQ};
use mito2::config::MitoConfig;
+use query::stats::StatementStatistics;
use serde::{Deserialize, Serialize};
use servers::export_metrics::ExportMetricsOption;
use servers::grpc::GrpcOptions;
@@ -243,6 +251,13 @@ pub struct Instance {
_guard: Vec,
}
+impl Instance {
+ /// Find the socket addr of a server by its `name`.
+ pub async fn server_addr(&self, name: &str) -> Option {
+ self.frontend.server_handlers().addr(name).await
+ }
+}
+
#[async_trait]
impl App for Instance {
fn name(&self) -> &str {
@@ -333,7 +348,8 @@ pub struct StartCommand {
}
impl StartCommand {
- fn load_options(
+ /// Load the GreptimeDB options from various sources (command line, config file or env).
+ pub fn load_options(
&self,
global_options: &GlobalOptions,
) -> Result> {
@@ -423,7 +439,8 @@ impl StartCommand {
#[allow(unreachable_code)]
#[allow(unused_variables)]
#[allow(clippy::diverging_sub_expression)]
- async fn build(&self, opts: GreptimeOptions) -> Result {
+ /// Build GreptimeDB instance with the loaded options.
+ pub async fn build(&self, opts: GreptimeOptions) -> Result {
common_runtime::init_global_runtimes(&opts.runtime);
let guard = common_telemetry::init_global_logging(
@@ -438,15 +455,16 @@ impl StartCommand {
info!("Standalone options: {opts:#?}");
let mut plugins = Plugins::new();
+ let plugin_opts = opts.plugins;
let opts = opts.component;
let fe_opts = opts.frontend_options();
let dn_opts = opts.datanode_options();
- plugins::setup_frontend_plugins(&mut plugins, &fe_opts)
+ plugins::setup_frontend_plugins(&mut plugins, &plugin_opts, &fe_opts)
.await
.context(StartFrontendSnafu)?;
- plugins::setup_datanode_plugins(&mut plugins, &dn_opts)
+ plugins::setup_datanode_plugins(&mut plugins, &plugin_opts, &dn_opts)
.await
.context(StartDatanodeSnafu)?;
@@ -477,22 +495,26 @@ impl StartCommand {
.build(),
);
- let catalog_manager = KvBackendCatalogManager::new(
- dn_opts.mode,
- None,
- kv_backend.clone(),
- layered_cache_registry.clone(),
- );
-
- let table_metadata_manager =
- Self::create_table_metadata_manager(kv_backend.clone()).await?;
-
let datanode = DatanodeBuilder::new(dn_opts, plugins.clone())
.with_kv_backend(kv_backend.clone())
.build()
.await
.context(StartDatanodeSnafu)?;
+ let information_extension = Arc::new(StandaloneInformationExtension::new(
+ datanode.region_server(),
+ procedure_manager.clone(),
+ ));
+ let catalog_manager = KvBackendCatalogManager::new(
+ information_extension,
+ kv_backend.clone(),
+ layered_cache_registry.clone(),
+ Some(procedure_manager.clone()),
+ );
+
+ let table_metadata_manager =
+ Self::create_table_metadata_manager(kv_backend.clone()).await?;
+
let flow_metadata_manager = Arc::new(FlowMetadataManager::new(kv_backend.clone()));
let flow_builder = FlownodeBuilder::new(
Default::default(),
@@ -556,6 +578,7 @@ impl StartCommand {
catalog_manager.clone(),
node_manager.clone(),
ddl_task_executor.clone(),
+ StatementStatistics::new(opts.logging.slow_query.clone()),
)
.with_plugin(plugins.clone())
.try_build()
@@ -641,6 +664,93 @@ impl StartCommand {
}
}
+pub struct StandaloneInformationExtension {
+ region_server: RegionServer,
+ procedure_manager: ProcedureManagerRef,
+ start_time_ms: u64,
+}
+
+impl StandaloneInformationExtension {
+ pub fn new(region_server: RegionServer, procedure_manager: ProcedureManagerRef) -> Self {
+ Self {
+ region_server,
+ procedure_manager,
+ start_time_ms: common_time::util::current_time_millis() as u64,
+ }
+ }
+}
+
+#[async_trait::async_trait]
+impl InformationExtension for StandaloneInformationExtension {
+ type Error = catalog::error::Error;
+
+ async fn nodes(&self) -> std::result::Result, Self::Error> {
+ let build_info = common_version::build_info();
+ let node_info = NodeInfo {
+ // For the standalone:
+ // - id always 0
+ // - empty string for peer_addr
+ peer: Peer {
+ id: 0,
+ addr: "".to_string(),
+ },
+ last_activity_ts: -1,
+ status: NodeStatus::Standalone,
+ version: build_info.version.to_string(),
+ git_commit: build_info.commit_short.to_string(),
+ // Use `self.start_time_ms` instead.
+ // It's not precise but enough.
+ start_time_ms: self.start_time_ms,
+ };
+ Ok(vec![node_info])
+ }
+
+ async fn procedures(&self) -> std::result::Result, Self::Error> {
+ self.procedure_manager
+ .list_procedures()
+ .await
+ .map_err(BoxedError::new)
+ .map(|procedures| {
+ procedures
+ .into_iter()
+ .map(|procedure| {
+ let status = procedure.state.as_str_name().to_string();
+ (status, procedure)
+ })
+ .collect::>()
+ })
+ .context(catalog::error::ListProceduresSnafu)
+ }
+
+ async fn region_stats(&self) -> std::result::Result, Self::Error> {
+ let stats = self
+ .region_server
+ .reportable_regions()
+ .into_iter()
+ .map(|stat| {
+ let region_stat = self
+ .region_server
+ .region_statistic(stat.region_id)
+ .unwrap_or_default();
+ RegionStat {
+ id: stat.region_id,
+ rcus: 0,
+ wcus: 0,
+ approximate_bytes: region_stat.estimated_disk_size(),
+ engine: stat.engine,
+ role: RegionRole::from(stat.role).into(),
+ num_rows: region_stat.num_rows,
+ memtable_size: region_stat.memtable_size,
+ manifest_size: region_stat.manifest_size,
+ sst_size: region_stat.sst_size,
+ index_size: region_stat.index_size,
+ }
+ })
+ .collect::>();
+ Ok(stats)
+ }
+}
+
#[cfg(test)]
mod tests {
use std::default::Default;
@@ -665,7 +775,7 @@ mod tests {
};
let mut plugins = Plugins::new();
- plugins::setup_frontend_plugins(&mut plugins, &fe_opts)
+ plugins::setup_frontend_plugins(&mut plugins, &[], &fe_opts)
.await
.unwrap();
diff --git a/src/cmd/tests/load_config_test.rs b/src/cmd/tests/load_config_test.rs
index 78d0786f7c..bf4871e0bd 100644
--- a/src/cmd/tests/load_config_test.rs
+++ b/src/cmd/tests/load_config_test.rs
@@ -16,13 +16,11 @@ use std::time::Duration;
use cmd::options::GreptimeOptions;
use cmd::standalone::StandaloneOptions;
-use common_base::readable_size::ReadableSize;
use common_config::Configurable;
use common_grpc::channel_manager::{
DEFAULT_MAX_GRPC_RECV_MESSAGE_SIZE, DEFAULT_MAX_GRPC_SEND_MESSAGE_SIZE,
};
-use common_runtime::global::RuntimeOptions;
-use common_telemetry::logging::{LoggingOptions, DEFAULT_OTLP_ENDPOINT};
+use common_telemetry::logging::{LoggingOptions, SlowQueryOptions, DEFAULT_OTLP_ENDPOINT};
use common_wal::config::raft_engine::RaftEngineConfig;
use common_wal::config::DatanodeWalConfig;
use datanode::config::{DatanodeOptions, RegionEngineConfig, StorageConfig};
@@ -45,10 +43,6 @@ fn test_load_datanode_example_config() {
.unwrap();
let expected = GreptimeOptions:: {
- runtime: RuntimeOptions {
- global_rt_size: 8,
- compact_rt_size: 4,
- },
component: DatanodeOptions {
node_id: Some(42),
meta_client: Some(MetaClientOptions {
@@ -74,16 +68,8 @@ fn test_load_datanode_example_config() {
},
region_engine: vec![
RegionEngineConfig::Mito(MitoConfig {
- num_workers: 8,
auto_flush_interval: Duration::from_secs(3600),
scan_parallelism: 0,
- global_write_buffer_size: ReadableSize::gb(1),
- global_write_buffer_reject_size: ReadableSize::gb(2),
- sst_meta_cache_size: ReadableSize::mb(128),
- vector_cache_size: ReadableSize::mb(512),
- page_cache_size: ReadableSize::mb(512),
- selector_result_cache_size: ReadableSize::mb(512),
- max_background_jobs: 4,
experimental_write_cache_ttl: Some(Duration::from_secs(60 * 60 * 8)),
..Default::default()
}),
@@ -108,9 +94,10 @@ fn test_load_datanode_example_config() {
rpc_max_send_message_size: Some(DEFAULT_MAX_GRPC_SEND_MESSAGE_SIZE),
..Default::default()
},
+ ..Default::default()
};
- assert_eq!(options, expected);
+ similar_asserts::assert_eq!(options, expected);
}
#[test]
@@ -120,10 +107,6 @@ fn test_load_frontend_example_config() {
GreptimeOptions::::load_layered_options(example_config.to_str(), "")
.unwrap();
let expected = GreptimeOptions:: {
- runtime: RuntimeOptions {
- global_rt_size: 8,
- compact_rt_size: 4,
- },
component: FrontendOptions {
default_timezone: Some("UTC".to_string()),
meta_client: Some(MetaClientOptions {
@@ -156,8 +139,9 @@ fn test_load_frontend_example_config() {
},
..Default::default()
},
+ ..Default::default()
};
- assert_eq!(options, expected);
+ similar_asserts::assert_eq!(options, expected);
}
#[test]
@@ -167,10 +151,6 @@ fn test_load_metasrv_example_config() {
GreptimeOptions::::load_layered_options(example_config.to_str(), "")
.unwrap();
let expected = GreptimeOptions:: {
- runtime: RuntimeOptions {
- global_rt_size: 8,
- compact_rt_size: 4,
- },
component: MetasrvOptions {
selector: SelectorType::default(),
data_home: "/tmp/metasrv/".to_string(),
@@ -179,8 +159,20 @@ fn test_load_metasrv_example_config() {
level: Some("info".to_string()),
otlp_endpoint: Some(DEFAULT_OTLP_ENDPOINT.to_string()),
tracing_sample_ratio: Some(Default::default()),
+ slow_query: SlowQueryOptions {
+ enable: false,
+ threshold: Some(Duration::from_secs(10)),
+ sample_ratio: Some(1.0),
+ },
..Default::default()
},
+ datanode: meta_srv::metasrv::DatanodeOptions {
+ client: meta_srv::metasrv::DatanodeClientOptions {
+ timeout: Duration::from_secs(10),
+ connect_timeout: Duration::from_secs(10),
+ tcp_nodelay: true,
+ },
+ },
export_metrics: ExportMetricsOption {
self_import: Some(Default::default()),
remote_write: Some(Default::default()),
@@ -188,8 +180,9 @@ fn test_load_metasrv_example_config() {
},
..Default::default()
},
+ ..Default::default()
};
- assert_eq!(options, expected);
+ similar_asserts::assert_eq!(options, expected);
}
#[test]
@@ -199,10 +192,6 @@ fn test_load_standalone_example_config() {
GreptimeOptions::::load_layered_options(example_config.to_str(), "")
.unwrap();
let expected = GreptimeOptions:: {
- runtime: RuntimeOptions {
- global_rt_size: 8,
- compact_rt_size: 4,
- },
component: StandaloneOptions {
default_timezone: Some("UTC".to_string()),
wal: DatanodeWalConfig::RaftEngine(RaftEngineConfig {
@@ -213,17 +202,9 @@ fn test_load_standalone_example_config() {
}),
region_engine: vec![
RegionEngineConfig::Mito(MitoConfig {
- num_workers: 8,
auto_flush_interval: Duration::from_secs(3600),
- scan_parallelism: 0,
- global_write_buffer_size: ReadableSize::gb(1),
- global_write_buffer_reject_size: ReadableSize::gb(2),
- sst_meta_cache_size: ReadableSize::mb(128),
- vector_cache_size: ReadableSize::mb(512),
- page_cache_size: ReadableSize::mb(512),
- selector_result_cache_size: ReadableSize::mb(512),
- max_background_jobs: 4,
experimental_write_cache_ttl: Some(Duration::from_secs(60 * 60 * 8)),
+ scan_parallelism: 0,
..Default::default()
}),
RegionEngineConfig::File(EngineConfig {}),
@@ -245,6 +226,7 @@ fn test_load_standalone_example_config() {
},
..Default::default()
},
+ ..Default::default()
};
- assert_eq!(options, expected);
+ similar_asserts::assert_eq!(options, expected);
}
diff --git a/src/common/base/Cargo.toml b/src/common/base/Cargo.toml
index 5afbc3b88c..5dfde47bf2 100644
--- a/src/common/base/Cargo.toml
+++ b/src/common/base/Cargo.toml
@@ -8,7 +8,7 @@ license.workspace = true
workspace = true
[dependencies]
-anymap = "1.0.0-beta.2"
+anymap2 = "0.13"
async-trait.workspace = true
bitvec = "1.0"
bytes.workspace = true
diff --git a/src/common/base/src/plugins.rs b/src/common/base/src/plugins.rs
index 84d78b0c91..c392422b64 100644
--- a/src/common/base/src/plugins.rs
+++ b/src/common/base/src/plugins.rs
@@ -12,20 +12,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-use std::any::Any;
use std::sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard};
-/// [`Plugins`] is a wrapper of [AnyMap](https://github.com/chris-morgan/anymap) and provides a thread-safe way to store and retrieve plugins.
+use anymap2::SendSyncAnyMap;
+
+/// [`Plugins`] is a wrapper of [anymap2](https://github.com/azriel91/anymap2) and provides a thread-safe way to store and retrieve plugins.
/// Make it Cloneable and we can treat it like an Arc struct.
#[derive(Default, Clone)]
pub struct Plugins {
- inner: Arc>>,
+ inner: Arc>,
}
impl Plugins {
pub fn new() -> Self {
Self {
- inner: Arc::new(RwLock::new(anymap::Map::new())),
+ inner: Arc::new(RwLock::new(SendSyncAnyMap::new())),
}
}
@@ -37,6 +38,18 @@ impl Plugins {
self.read().get::().cloned()
}
+ pub fn get_or_insert(&self, f: F) -> T
+ where
+ T: 'static + Send + Sync + Clone,
+ F: FnOnce() -> T,
+ {
+ let mut binding = self.write();
+ if !binding.contains::() {
+ binding.insert(f());
+ }
+ binding.get::().cloned().unwrap()
+ }
+
pub fn map_mut(&self, mapper: F) -> R
where
F: FnOnce(Option<&mut T>) -> R,
@@ -61,11 +74,11 @@ impl Plugins {
self.read().is_empty()
}
- fn read(&self) -> RwLockReadGuard> {
+ fn read(&self) -> RwLockReadGuard {
self.inner.read().unwrap()
}
- fn write(&self) -> RwLockWriteGuard> {
+ fn write(&self) -> RwLockWriteGuard {
self.inner.write().unwrap()
}
}
diff --git a/src/common/base/src/range_read.rs b/src/common/base/src/range_read.rs
index 920b2e1f8c..4e7a48a8b7 100644
--- a/src/common/base/src/range_read.rs
+++ b/src/common/base/src/range_read.rs
@@ -60,21 +60,46 @@ pub trait RangeReader: Send + Unpin {
}
}
-/// Implement `RangeReader` for a type that implements `AsyncRead + AsyncSeek`.
+#[async_trait]
+impl RangeReader for &mut R {
+ async fn metadata(&mut self) -> io::Result {
+ (*self).metadata().await
+ }
+ async fn read(&mut self, range: Range) -> io::Result {
+ (*self).read(range).await
+ }
+ async fn read_into(
+ &mut self,
+ range: Range,
+ buf: &mut (impl BufMut + Send),
+ ) -> io::Result<()> {
+ (*self).read_into(range, buf).await
+ }
+ async fn read_vec(&mut self, ranges: &[Range]) -> io::Result> {
+ (*self).read_vec(ranges).await
+ }
+}
+
+/// `RangeReaderAdapter` bridges `RangeReader` and `AsyncRead + AsyncSeek`.
+pub struct RangeReaderAdapter(pub R);
+
+/// Implements `RangeReader` for a type that implements `AsyncRead + AsyncSeek`.
///
/// TODO(zhongzc): It's a temporary solution for porting the codebase from `AsyncRead + AsyncSeek` to `RangeReader`.
/// Until the codebase is fully ported to `RangeReader`, remove this implementation.
#[async_trait]
-impl RangeReader for R {
+impl RangeReader
+ for RangeReaderAdapter
+{
async fn metadata(&mut self) -> io::Result {
- let content_length = self.seek(io::SeekFrom::End(0)).await?;
+ let content_length = self.0.seek(io::SeekFrom::End(0)).await?;
Ok(Metadata { content_length })
}
async fn read(&mut self, range: Range) -> io::Result {
let mut buf = vec![0; (range.end - range.start) as usize];
- self.seek(io::SeekFrom::Start(range.start)).await?;
- self.read_exact(&mut buf).await?;
+ self.0.seek(io::SeekFrom::Start(range.start)).await?;
+ self.0.read_exact(&mut buf).await?;
Ok(Bytes::from(buf))
}
}
diff --git a/src/common/base/src/secrets.rs b/src/common/base/src/secrets.rs
index 702b6d3ccd..b3f4347578 100644
--- a/src/common/base/src/secrets.rs
+++ b/src/common/base/src/secrets.rs
@@ -46,8 +46,9 @@ impl From for SecretString {
}
}
-/// Wrapper type for values that contains secrets, which attempts to limit
-/// accidental exposure and ensure secrets are wiped from memory when dropped.
+/// Wrapper type for values that contains secrets.
+///
+/// It attempts to limit accidental exposure and ensure secrets are wiped from memory when dropped.
/// (e.g. passwords, cryptographic keys, access tokens or other credentials)
///
/// Access to the secret inner value occurs through the [`ExposeSecret`]
diff --git a/src/common/catalog/src/consts.rs b/src/common/catalog/src/consts.rs
index 6020a4bef8..5a73e8ddae 100644
--- a/src/common/catalog/src/consts.rs
+++ b/src/common/catalog/src/consts.rs
@@ -98,14 +98,20 @@ pub const INFORMATION_SCHEMA_CLUSTER_INFO_TABLE_ID: u32 = 31;
pub const INFORMATION_SCHEMA_VIEW_TABLE_ID: u32 = 32;
/// id for information_schema.FLOWS
pub const INFORMATION_SCHEMA_FLOW_TABLE_ID: u32 = 33;
-/// ----- End of information_schema tables -----
+/// id for information_schema.procedure_info
+pub const INFORMATION_SCHEMA_PROCEDURE_INFO_TABLE_ID: u32 = 34;
+/// id for information_schema.region_statistics
+pub const INFORMATION_SCHEMA_REGION_STATISTICS_TABLE_ID: u32 = 35;
+
+// ----- End of information_schema tables -----
/// ----- Begin of pg_catalog tables -----
pub const PG_CATALOG_PG_CLASS_TABLE_ID: u32 = 256;
pub const PG_CATALOG_PG_TYPE_TABLE_ID: u32 = 257;
pub const PG_CATALOG_PG_NAMESPACE_TABLE_ID: u32 = 258;
-/// ----- End of pg_catalog tables -----
+// ----- End of pg_catalog tables -----
+
pub const MITO_ENGINE: &str = "mito";
pub const MITO2_ENGINE: &str = "mito2";
pub const METRIC_ENGINE: &str = "metric";
diff --git a/src/common/error/src/status_code.rs b/src/common/error/src/status_code.rs
index 11b4c7587e..239871e1d1 100644
--- a/src/common/error/src/status_code.rs
+++ b/src/common/error/src/status_code.rs
@@ -38,6 +38,8 @@ pub enum StatusCode {
Cancelled = 1005,
/// Illegal state, can be exposed to users.
IllegalState = 1006,
+ /// Caused by some error originated from external system.
+ External = 1007,
// ====== End of common status code ================
// ====== Begin of SQL related status code =========
@@ -162,7 +164,8 @@ impl StatusCode {
| StatusCode::InvalidAuthHeader
| StatusCode::AccessDenied
| StatusCode::PermissionDenied
- | StatusCode::RequestOutdated => false,
+ | StatusCode::RequestOutdated
+ | StatusCode::External => false,
}
}
@@ -177,7 +180,9 @@ impl StatusCode {
| StatusCode::IllegalState
| StatusCode::EngineExecuteQuery
| StatusCode::StorageUnavailable
- | StatusCode::RuntimeResourcesExhausted => true,
+ | StatusCode::RuntimeResourcesExhausted
+ | StatusCode::External => true,
+
StatusCode::Success
| StatusCode::Unsupported
| StatusCode::InvalidArguments
@@ -256,7 +261,7 @@ macro_rules! define_into_tonic_status {
pub fn status_to_tonic_code(status_code: StatusCode) -> Code {
match status_code {
StatusCode::Success => Code::Ok,
- StatusCode::Unknown => Code::Unknown,
+ StatusCode::Unknown | StatusCode::External => Code::Unknown,
StatusCode::Unsupported => Code::Unimplemented,
StatusCode::Unexpected
| StatusCode::IllegalState
diff --git a/src/common/function/Cargo.toml b/src/common/function/Cargo.toml
index b2e9c5a98b..6b23762d90 100644
--- a/src/common/function/Cargo.toml
+++ b/src/common/function/Cargo.toml
@@ -9,7 +9,7 @@ workspace = true
[features]
default = ["geo"]
-geo = ["geohash", "h3o"]
+geo = ["geohash", "h3o", "s2"]
[dependencies]
api.workspace = true
@@ -27,6 +27,7 @@ common-time.workspace = true
common-version.workspace = true
datafusion.workspace = true
datatypes.workspace = true
+derive_more = { version = "1", default-features = false, features = ["display"] }
geohash = { version = "0.13", optional = true }
h3o = { version = "0.6", optional = true }
jsonb.workspace = true
@@ -34,6 +35,7 @@ num = "0.4"
num-traits = "0.2"
once_cell.workspace = true
paste = "1.0"
+s2 = { version = "0.0.12", optional = true }
serde.workspace = true
serde_json.workspace = true
session.workspace = true
diff --git a/src/common/function/src/scalars/aggregate.rs b/src/common/function/src/scalars/aggregate.rs
index 7ed4530983..08edf43568 100644
--- a/src/common/function/src/scalars/aggregate.rs
+++ b/src/common/function/src/scalars/aggregate.rs
@@ -16,7 +16,6 @@ mod argmax;
mod argmin;
mod diff;
mod mean;
-mod percentile;
mod polyval;
mod scipy_stats_norm_cdf;
mod scipy_stats_norm_pdf;
@@ -28,7 +27,6 @@ pub use argmin::ArgminAccumulatorCreator;
use common_query::logical_plan::AggregateFunctionCreatorRef;
pub use diff::DiffAccumulatorCreator;
pub use mean::MeanAccumulatorCreator;
-pub use percentile::PercentileAccumulatorCreator;
pub use polyval::PolyvalAccumulatorCreator;
pub use scipy_stats_norm_cdf::ScipyStatsNormCdfAccumulatorCreator;
pub use scipy_stats_norm_pdf::ScipyStatsNormPdfAccumulatorCreator;
@@ -91,8 +89,14 @@ impl AggregateFunctions {
register_aggr_func!("polyval", 2, PolyvalAccumulatorCreator);
register_aggr_func!("argmax", 1, ArgmaxAccumulatorCreator);
register_aggr_func!("argmin", 1, ArgminAccumulatorCreator);
- register_aggr_func!("percentile", 2, PercentileAccumulatorCreator);
register_aggr_func!("scipystatsnormcdf", 2, ScipyStatsNormCdfAccumulatorCreator);
register_aggr_func!("scipystatsnormpdf", 2, ScipyStatsNormPdfAccumulatorCreator);
+
+ #[cfg(feature = "geo")]
+ register_aggr_func!(
+ "json_encode_path",
+ 3,
+ super::geo::encoding::JsonPathEncodeFunctionCreator
+ );
}
}
diff --git a/src/common/function/src/scalars/aggregate/argmax.rs b/src/common/function/src/scalars/aggregate/argmax.rs
index c5c5264f19..4749ff9a3a 100644
--- a/src/common/function/src/scalars/aggregate/argmax.rs
+++ b/src/common/function/src/scalars/aggregate/argmax.rs
@@ -16,7 +16,10 @@ use std::cmp::Ordering;
use std::sync::Arc;
use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
-use common_query::error::{BadAccumulatorImplSnafu, CreateAccumulatorSnafu, Result};
+use common_query::error::{
+ BadAccumulatorImplSnafu, CreateAccumulatorSnafu, InvalidInputStateSnafu, Result,
+};
+use common_query::logical_plan::accumulator::AggrFuncTypeStore;
use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
use common_query::prelude::*;
use datatypes::prelude::*;
diff --git a/src/common/function/src/scalars/aggregate/argmin.rs b/src/common/function/src/scalars/aggregate/argmin.rs
index 7233f43b77..fe89184460 100644
--- a/src/common/function/src/scalars/aggregate/argmin.rs
+++ b/src/common/function/src/scalars/aggregate/argmin.rs
@@ -16,7 +16,10 @@ use std::cmp::Ordering;
use std::sync::Arc;
use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
-use common_query::error::{BadAccumulatorImplSnafu, CreateAccumulatorSnafu, Result};
+use common_query::error::{
+ BadAccumulatorImplSnafu, CreateAccumulatorSnafu, InvalidInputStateSnafu, Result,
+};
+use common_query::logical_plan::accumulator::AggrFuncTypeStore;
use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
use common_query::prelude::*;
use datatypes::prelude::*;
diff --git a/src/common/function/src/scalars/aggregate/diff.rs b/src/common/function/src/scalars/aggregate/diff.rs
index b83ed6d004..25d1614e4b 100644
--- a/src/common/function/src/scalars/aggregate/diff.rs
+++ b/src/common/function/src/scalars/aggregate/diff.rs
@@ -17,8 +17,10 @@ use std::sync::Arc;
use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
use common_query::error::{
- CreateAccumulatorSnafu, DowncastVectorSnafu, FromScalarValueSnafu, Result,
+ CreateAccumulatorSnafu, DowncastVectorSnafu, FromScalarValueSnafu, InvalidInputStateSnafu,
+ Result,
};
+use common_query::logical_plan::accumulator::AggrFuncTypeStore;
use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
use common_query::prelude::*;
use datatypes::prelude::*;
diff --git a/src/common/function/src/scalars/aggregate/mean.rs b/src/common/function/src/scalars/aggregate/mean.rs
index 3dc3e18535..ed66c90bdb 100644
--- a/src/common/function/src/scalars/aggregate/mean.rs
+++ b/src/common/function/src/scalars/aggregate/mean.rs
@@ -17,8 +17,10 @@ use std::sync::Arc;
use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
use common_query::error::{
- BadAccumulatorImplSnafu, CreateAccumulatorSnafu, DowncastVectorSnafu, Result,
+ BadAccumulatorImplSnafu, CreateAccumulatorSnafu, DowncastVectorSnafu, InvalidInputStateSnafu,
+ Result,
};
+use common_query::logical_plan::accumulator::AggrFuncTypeStore;
use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
use common_query::prelude::*;
use datatypes::prelude::*;
diff --git a/src/common/function/src/scalars/aggregate/percentile.rs b/src/common/function/src/scalars/aggregate/percentile.rs
deleted file mode 100644
index 2d3e5482fe..0000000000
--- a/src/common/function/src/scalars/aggregate/percentile.rs
+++ /dev/null
@@ -1,436 +0,0 @@
-// Copyright 2023 Greptime Team
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::cmp::Reverse;
-use std::collections::BinaryHeap;
-use std::sync::Arc;
-
-use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
-use common_query::error::{
- self, BadAccumulatorImplSnafu, CreateAccumulatorSnafu, DowncastVectorSnafu,
- FromScalarValueSnafu, InvalidInputColSnafu, Result,
-};
-use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
-use common_query::prelude::*;
-use datatypes::prelude::*;
-use datatypes::types::OrdPrimitive;
-use datatypes::value::{ListValue, OrderedFloat};
-use datatypes::vectors::{ConstantVector, Float64Vector, Helper, ListVector};
-use datatypes::with_match_primitive_type_id;
-use num::NumCast;
-use snafu::{ensure, OptionExt, ResultExt};
-
-// https://numpy.org/doc/stable/reference/generated/numpy.percentile.html?highlight=percentile#numpy.percentile
-// if the p is 50,then the Percentile become median
-// we use two heap great and not_greater
-// the not_greater push the value that smaller than P-value
-// the greater push the value that bigger than P-value
-// just like the percentile in numpy:
-// Given a vector V of length N, the q-th percentile of V is the value q/100 of the way from the minimum to the maximum in a sorted copy of V.
-// The values and distances of the two nearest neighbors as well as the method parameter will determine the percentile
-// if the normalized ranking does not match the location of q exactly.
-// This function is the same as the median if q=50, the same as the minimum if q=0 and the same as the maximum if q=100.
-// This optional method parameter specifies the method to use when the desired quantile lies between two data points i < j.
-// If g is the fractional part of the index surrounded by i and alpha and beta are correction constants modifying i and j.
-// i+g = (q-alpha)/(n-alpha-beta+1)
-// Below, 'q' is the quantile value, 'n' is the sample size and alpha and beta are constants. The following formula gives an interpolation "i + g" of where the quantile would be in the sorted sample.
-// With 'i' being the floor and 'g' the fractional part of the result.
-// the default method is linear where
-// alpha = 1
-// beta = 1
-#[derive(Debug, Default)]
-pub struct Percentile
-where
- T: WrapperType,
-{
- greater: BinaryHeap>>,
- not_greater: BinaryHeap>,
- n: u64,
- p: Option,
-}
-
-impl Percentile
-where
- T: WrapperType,
-{
- fn push(&mut self, value: T) {
- let value = OrdPrimitive::(value);
-
- self.n += 1;
- if self.not_greater.is_empty() {
- self.not_greater.push(value);
- return;
- }
- // to keep the not_greater length == floor+1
- // so to ensure the peek of the not_greater is array[floor]
- // and the peek of the greater is array[floor+1]
- let p = self.p.unwrap_or(0.0_f64);
- let floor = (((self.n - 1) as f64) * p / (100_f64)).floor();
- if value <= *self.not_greater.peek().unwrap() {
- self.not_greater.push(value);
- if self.not_greater.len() > (floor + 1.0) as usize {
- self.greater.push(Reverse(self.not_greater.pop().unwrap()));
- }
- } else {
- self.greater.push(Reverse(value));
- if self.not_greater.len() < (floor + 1.0) as usize {
- self.not_greater.push(self.greater.pop().unwrap().0);
- }
- }
- }
-}
-
-impl Accumulator for Percentile
-where
- T: WrapperType,
-{
- fn state(&self) -> Result> {
- let nums = self
- .greater
- .iter()
- .map(|x| &x.0)
- .chain(self.not_greater.iter())
- .map(|&n| n.into())
- .collect::>();
- Ok(vec![
- Value::List(ListValue::new(nums, T::LogicalType::build_data_type())),
- self.p.into(),
- ])
- }
-
- fn update_batch(&mut self, values: &[VectorRef]) -> Result<()> {
- if values.is_empty() {
- return Ok(());
- }
- ensure!(values.len() == 2, InvalidInputStateSnafu);
- ensure!(values[0].len() == values[1].len(), InvalidInputStateSnafu);
-
- if values[0].len() == 0 {
- return Ok(());
- }
-
- // This is a unary accumulator, so only one column is provided.
- let column = &values[0];
- let mut len = 1;
- let column: &::VectorType = if column.is_const() {
- len = column.len();
- let column: &ConstantVector = unsafe { Helper::static_cast(column) };
- unsafe { Helper::static_cast(column.inner()) }
- } else {
- unsafe { Helper::static_cast(column) }
- };
-
- let x = &values[1];
- let x = Helper::check_get_scalar::(x).context(error::InvalidInputTypeSnafu {
- err_msg: "expecting \"POLYVAL\" function's second argument to be float64",
- })?;
- // `get(0)` is safe because we have checked `values[1].len() == values[0].len() != 0`
- let first = x.get(0);
- ensure!(!first.is_null(), InvalidInputColSnafu);
-
- for i in 1..x.len() {
- ensure!(first == x.get(i), InvalidInputColSnafu);
- }
-
- let first = match first {
- Value::Float64(OrderedFloat(v)) => v,
- // unreachable because we have checked `first` is not null and is i64 above
- _ => unreachable!(),
- };
- if let Some(p) = self.p {
- ensure!(p == first, InvalidInputColSnafu);
- } else {
- self.p = Some(first);
- };
-
- (0..len).for_each(|_| {
- for v in column.iter_data().flatten() {
- self.push(v);
- }
- });
- Ok(())
- }
-
- fn merge_batch(&mut self, states: &[VectorRef]) -> Result<()> {
- if states.is_empty() {
- return Ok(());
- }
-
- ensure!(
- states.len() == 2,
- BadAccumulatorImplSnafu {
- err_msg: "expect 2 states in `merge_batch`"
- }
- );
-
- let p = &states[1];
- let p = p
- .as_any()
- .downcast_ref::()
- .with_context(|| DowncastVectorSnafu {
- err_msg: format!(
- "expect float64vector, got vector type {}",
- p.vector_type_name()
- ),
- })?;
- let p = p.get(0);
- if p.is_null() {
- return Ok(());
- }
- let p = match p {
- Value::Float64(OrderedFloat(p)) => p,
- _ => unreachable!(),
- };
- self.p = Some(p);
-
- let values = &states[0];
- let values = values
- .as_any()
- .downcast_ref::()
- .with_context(|| DowncastVectorSnafu {
- err_msg: format!(
- "expect ListVector, got vector type {}",
- values.vector_type_name()
- ),
- })?;
- for value in values.values_iter() {
- if let Some(value) = value.context(FromScalarValueSnafu)? {
- let column: &::VectorType = unsafe { Helper::static_cast(&value) };
- for v in column.iter_data().flatten() {
- self.push(v);
- }
- }
- }
- Ok(())
- }
-
- fn evaluate(&self) -> Result {
- if self.not_greater.is_empty() {
- assert!(
- self.greater.is_empty(),
- "not expected in two-heap percentile algorithm, there must be a bug when implementing it"
- );
- }
- let not_greater = self.not_greater.peek();
- if not_greater.is_none() {
- return Ok(Value::Null);
- }
- let not_greater = (*self.not_greater.peek().unwrap()).as_primitive();
- let percentile = if self.greater.is_empty() {
- NumCast::from(not_greater).unwrap()
- } else {
- let greater = self.greater.peek().unwrap();
- let p = if let Some(p) = self.p {
- p
- } else {
- return Ok(Value::Null);
- };
- let fract = (((self.n - 1) as f64) * p / 100_f64).fract();
- let not_greater_v: f64 = NumCast::from(not_greater).unwrap();
- let greater_v: f64 = NumCast::from(greater.0.as_primitive()).unwrap();
- not_greater_v * (1.0 - fract) + greater_v * fract
- };
- Ok(Value::from(percentile))
- }
-}
-
-#[as_aggr_func_creator]
-#[derive(Debug, Default, AggrFuncTypeStore)]
-pub struct PercentileAccumulatorCreator {}
-
-impl AggregateFunctionCreator for PercentileAccumulatorCreator {
- fn creator(&self) -> AccumulatorCreatorFunction {
- let creator: AccumulatorCreatorFunction = Arc::new(move |types: &[ConcreteDataType]| {
- let input_type = &types[0];
- with_match_primitive_type_id!(
- input_type.logical_type_id(),
- |$S| {
- Ok(Box::new(Percentile::<<$S as LogicalPrimitiveType>::Wrapper>::default()))
- },
- {
- let err_msg = format!(
- "\"PERCENTILE\" aggregate function not support data type {:?}",
- input_type.logical_type_id(),
- );
- CreateAccumulatorSnafu { err_msg }.fail()?
- }
- )
- });
- creator
- }
-
- fn output_type(&self) -> Result {
- let input_types = self.input_types()?;
- ensure!(input_types.len() == 2, InvalidInputStateSnafu);
- // unwrap is safe because we have checked input_types len must equals 1
- Ok(ConcreteDataType::float64_datatype())
- }
-
- fn state_types(&self) -> Result> {
- let input_types = self.input_types()?;
- ensure!(input_types.len() == 2, InvalidInputStateSnafu);
- Ok(vec![
- ConcreteDataType::list_datatype(input_types.into_iter().next().unwrap()),
- ConcreteDataType::float64_datatype(),
- ])
- }
-}
-
-#[cfg(test)]
-mod test {
- use datatypes::vectors::{Float64Vector, Int32Vector};
-
- use super::*;
- #[test]
- fn test_update_batch() {
- // test update empty batch, expect not updating anything
- let mut percentile = Percentile::::default();
- percentile.update_batch(&[]).unwrap();
- assert!(percentile.not_greater.is_empty());
- assert!(percentile.greater.is_empty());
- assert_eq!(Value::Null, percentile.evaluate().unwrap());
-
- // test update one not-null value
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Some(42)])),
- Arc::new(Float64Vector::from(vec![Some(100.0_f64)])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::from(42.0_f64), percentile.evaluate().unwrap());
-
- // test update one null value
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Option::::None])),
- Arc::new(Float64Vector::from(vec![Some(100.0_f64)])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::Null, percentile.evaluate().unwrap());
-
- // test update no null-value batch
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Some(-1i32), Some(1), Some(2)])),
- Arc::new(Float64Vector::from(vec![
- Some(100.0_f64),
- Some(100.0_f64),
- Some(100.0_f64),
- ])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::from(2_f64), percentile.evaluate().unwrap());
-
- // test update null-value batch
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Some(-2i32), None, Some(3), Some(4)])),
- Arc::new(Float64Vector::from(vec![
- Some(100.0_f64),
- Some(100.0_f64),
- Some(100.0_f64),
- Some(100.0_f64),
- ])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::from(4_f64), percentile.evaluate().unwrap());
-
- // test update with constant vector
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(ConstantVector::new(
- Arc::new(Int32Vector::from_vec(vec![4])),
- 2,
- )),
- Arc::new(Float64Vector::from(vec![Some(100.0_f64), Some(100.0_f64)])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::from(4_f64), percentile.evaluate().unwrap());
-
- // test left border
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Some(-1i32), Some(1), Some(2)])),
- Arc::new(Float64Vector::from(vec![
- Some(0.0_f64),
- Some(0.0_f64),
- Some(0.0_f64),
- ])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::from(-1.0_f64), percentile.evaluate().unwrap());
-
- // test medium
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Some(-1i32), Some(1), Some(2)])),
- Arc::new(Float64Vector::from(vec![
- Some(50.0_f64),
- Some(50.0_f64),
- Some(50.0_f64),
- ])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::from(1.0_f64), percentile.evaluate().unwrap());
-
- // test right border
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Some(-1i32), Some(1), Some(2)])),
- Arc::new(Float64Vector::from(vec![
- Some(100.0_f64),
- Some(100.0_f64),
- Some(100.0_f64),
- ])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::from(2.0_f64), percentile.evaluate().unwrap());
-
- // the following is the result of numpy.percentile
- // numpy.percentile
- // a = np.array([[10,7,4]])
- // np.percentile(a,40)
- // >> 6.400000000000
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Some(10i32), Some(7), Some(4)])),
- Arc::new(Float64Vector::from(vec![
- Some(40.0_f64),
- Some(40.0_f64),
- Some(40.0_f64),
- ])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(Value::from(6.400000000_f64), percentile.evaluate().unwrap());
-
- // the following is the result of numpy.percentile
- // a = np.array([[10,7,4]])
- // np.percentile(a,95)
- // >> 9.7000000000000011
- let mut percentile = Percentile::::default();
- let v: Vec = vec![
- Arc::new(Int32Vector::from(vec![Some(10i32), Some(7), Some(4)])),
- Arc::new(Float64Vector::from(vec![
- Some(95.0_f64),
- Some(95.0_f64),
- Some(95.0_f64),
- ])),
- ];
- percentile.update_batch(&v).unwrap();
- assert_eq!(
- Value::from(9.700_000_000_000_001_f64),
- percentile.evaluate().unwrap()
- );
- }
-}
diff --git a/src/common/function/src/scalars/aggregate/polyval.rs b/src/common/function/src/scalars/aggregate/polyval.rs
index ae6ca101c4..bc3986fd0e 100644
--- a/src/common/function/src/scalars/aggregate/polyval.rs
+++ b/src/common/function/src/scalars/aggregate/polyval.rs
@@ -18,8 +18,9 @@ use std::sync::Arc;
use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
use common_query::error::{
self, BadAccumulatorImplSnafu, CreateAccumulatorSnafu, DowncastVectorSnafu,
- FromScalarValueSnafu, InvalidInputColSnafu, Result,
+ FromScalarValueSnafu, InvalidInputColSnafu, InvalidInputStateSnafu, Result,
};
+use common_query::logical_plan::accumulator::AggrFuncTypeStore;
use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
use common_query::prelude::*;
use datatypes::prelude::*;
diff --git a/src/common/function/src/scalars/aggregate/scipy_stats_norm_cdf.rs b/src/common/function/src/scalars/aggregate/scipy_stats_norm_cdf.rs
index e6c92225a6..09a9c820d8 100644
--- a/src/common/function/src/scalars/aggregate/scipy_stats_norm_cdf.rs
+++ b/src/common/function/src/scalars/aggregate/scipy_stats_norm_cdf.rs
@@ -17,8 +17,10 @@ use std::sync::Arc;
use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
use common_query::error::{
self, BadAccumulatorImplSnafu, CreateAccumulatorSnafu, DowncastVectorSnafu,
- FromScalarValueSnafu, GenerateFunctionSnafu, InvalidInputColSnafu, Result,
+ FromScalarValueSnafu, GenerateFunctionSnafu, InvalidInputColSnafu, InvalidInputStateSnafu,
+ Result,
};
+use common_query::logical_plan::accumulator::AggrFuncTypeStore;
use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
use common_query::prelude::*;
use datatypes::prelude::*;
diff --git a/src/common/function/src/scalars/aggregate/scipy_stats_norm_pdf.rs b/src/common/function/src/scalars/aggregate/scipy_stats_norm_pdf.rs
index 3045ae8665..2d5025ea3a 100644
--- a/src/common/function/src/scalars/aggregate/scipy_stats_norm_pdf.rs
+++ b/src/common/function/src/scalars/aggregate/scipy_stats_norm_pdf.rs
@@ -17,8 +17,10 @@ use std::sync::Arc;
use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
use common_query::error::{
self, BadAccumulatorImplSnafu, CreateAccumulatorSnafu, DowncastVectorSnafu,
- FromScalarValueSnafu, GenerateFunctionSnafu, InvalidInputColSnafu, Result,
+ FromScalarValueSnafu, GenerateFunctionSnafu, InvalidInputColSnafu, InvalidInputStateSnafu,
+ Result,
};
+use common_query::logical_plan::accumulator::AggrFuncTypeStore;
use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
use common_query::prelude::*;
use datatypes::prelude::*;
diff --git a/src/common/function/src/scalars/date/date_add.rs b/src/common/function/src/scalars/date/date_add.rs
index 1052acb868..2307d2caab 100644
--- a/src/common/function/src/scalars/date/date_add.rs
+++ b/src/common/function/src/scalars/date/date_add.rs
@@ -14,18 +14,19 @@
use std::fmt;
-use common_query::error::{InvalidFuncArgsSnafu, Result, UnsupportedInputDataTypeSnafu};
+use common_query::error::{ArrowComputeSnafu, IntoVectorSnafu, InvalidFuncArgsSnafu, Result};
use common_query::prelude::Signature;
-use datatypes::data_type::DataType;
+use datatypes::arrow::compute::kernels::numeric;
use datatypes::prelude::ConcreteDataType;
-use datatypes::value::ValueRef;
-use datatypes::vectors::VectorRef;
-use snafu::ensure;
+use datatypes::vectors::{Helper, VectorRef};
+use snafu::{ensure, ResultExt};
use crate::function::{Function, FunctionContext};
use crate::helper;
-/// A function adds an interval value to Timestamp, Date or DateTime, and return the result.
+/// A function adds an interval value to Timestamp, Date, and return the result.
+/// The implementation of datetime type is based on Date64 which is incorrect so this function
+/// doesn't support the datetime type.
#[derive(Clone, Debug, Default)]
pub struct DateAddFunction;
@@ -44,7 +45,6 @@ impl Function for DateAddFunction {
helper::one_of_sigs2(
vec![
ConcreteDataType::date_datatype(),
- ConcreteDataType::datetime_datatype(),
ConcreteDataType::timestamp_second_datatype(),
ConcreteDataType::timestamp_millisecond_datatype(),
ConcreteDataType::timestamp_microsecond_datatype(),
@@ -69,64 +69,14 @@ impl Function for DateAddFunction {
}
);
- let left = &columns[0];
- let right = &columns[1];
+ let left = columns[0].to_arrow_array();
+ let right = columns[1].to_arrow_array();
- let size = left.len();
- let left_datatype = columns[0].data_type();
- match left_datatype {
- ConcreteDataType::Timestamp(_) => {
- let mut result = left_datatype.create_mutable_vector(size);
- for i in 0..size {
- let ts = left.get(i).as_timestamp();
- let interval = right.get(i).as_interval();
-
- let new_ts = match (ts, interval) {
- (Some(ts), Some(interval)) => ts.add_interval(interval),
- _ => ts,
- };
-
- result.push_value_ref(ValueRef::from(new_ts));
- }
-
- Ok(result.to_vector())
- }
- ConcreteDataType::Date(_) => {
- let mut result = left_datatype.create_mutable_vector(size);
- for i in 0..size {
- let date = left.get(i).as_date();
- let interval = right.get(i).as_interval();
- let new_date = match (date, interval) {
- (Some(date), Some(interval)) => date.add_interval(interval),
- _ => date,
- };
-
- result.push_value_ref(ValueRef::from(new_date));
- }
-
- Ok(result.to_vector())
- }
- ConcreteDataType::DateTime(_) => {
- let mut result = left_datatype.create_mutable_vector(size);
- for i in 0..size {
- let datetime = left.get(i).as_datetime();
- let interval = right.get(i).as_interval();
- let new_datetime = match (datetime, interval) {
- (Some(datetime), Some(interval)) => datetime.add_interval(interval),
- _ => datetime,
- };
-
- result.push_value_ref(ValueRef::from(new_datetime));
- }
-
- Ok(result.to_vector())
- }
- _ => UnsupportedInputDataTypeSnafu {
- function: NAME,
- datatypes: columns.iter().map(|c| c.data_type()).collect::>(),
- }
- .fail(),
- }
+ let result = numeric::add(&left, &right).context(ArrowComputeSnafu)?;
+ let arrow_type = result.data_type().clone();
+ Helper::try_into_vector(result).context(IntoVectorSnafu {
+ data_type: arrow_type,
+ })
}
}
@@ -144,8 +94,7 @@ mod tests {
use datatypes::prelude::ConcreteDataType;
use datatypes::value::Value;
use datatypes::vectors::{
- DateTimeVector, DateVector, IntervalDayTimeVector, IntervalYearMonthVector,
- TimestampSecondVector,
+ DateVector, IntervalDayTimeVector, IntervalYearMonthVector, TimestampSecondVector,
};
use super::{DateAddFunction, *};
@@ -168,16 +117,15 @@ mod tests {
ConcreteDataType::date_datatype(),
f.return_type(&[ConcreteDataType::date_datatype()]).unwrap()
);
- assert_eq!(
- ConcreteDataType::datetime_datatype(),
- f.return_type(&[ConcreteDataType::datetime_datatype()])
- .unwrap()
- );
- assert!(matches!(f.signature(),
+ assert!(
+ matches!(f.signature(),
Signature {
type_signature: TypeSignature::OneOf(sigs),
volatility: Volatility::Immutable
- } if sigs.len() == 18));
+ } if sigs.len() == 15),
+ "{:?}",
+ f.signature()
+ );
}
#[test]
@@ -243,36 +191,4 @@ mod tests {
}
}
}
-
- #[test]
- fn test_datetime_date_add() {
- let f = DateAddFunction;
-
- let dates = vec![Some(123), None, Some(42), None];
- // Intervals in months
- let intervals = vec![1, 2, 3, 1];
- let results = [Some(2678400123), None, Some(7776000042), None];
-
- let date_vector = DateTimeVector::from(dates.clone());
- let interval_vector = IntervalYearMonthVector::from_vec(intervals);
- let args: Vec = vec![Arc::new(date_vector), Arc::new(interval_vector)];
- let vector = f.eval(FunctionContext::default(), &args).unwrap();
-
- assert_eq!(4, vector.len());
- for (i, _t) in dates.iter().enumerate() {
- let v = vector.get(i);
- let result = results.get(i).unwrap();
-
- if result.is_none() {
- assert_eq!(Value::Null, v);
- continue;
- }
- match v {
- Value::DateTime(date) => {
- assert_eq!(date.val(), result.unwrap());
- }
- _ => unreachable!(),
- }
- }
- }
}
diff --git a/src/common/function/src/scalars/date/date_sub.rs b/src/common/function/src/scalars/date/date_sub.rs
index b1f87e880a..1e00db5331 100644
--- a/src/common/function/src/scalars/date/date_sub.rs
+++ b/src/common/function/src/scalars/date/date_sub.rs
@@ -14,18 +14,19 @@
use std::fmt;
-use common_query::error::{InvalidFuncArgsSnafu, Result, UnsupportedInputDataTypeSnafu};
+use common_query::error::{ArrowComputeSnafu, IntoVectorSnafu, InvalidFuncArgsSnafu, Result};
use common_query::prelude::Signature;
-use datatypes::data_type::DataType;
+use datatypes::arrow::compute::kernels::numeric;
use datatypes::prelude::ConcreteDataType;
-use datatypes::value::ValueRef;
-use datatypes::vectors::VectorRef;
-use snafu::ensure;
+use datatypes::vectors::{Helper, VectorRef};
+use snafu::{ensure, ResultExt};
use crate::function::{Function, FunctionContext};
use crate::helper;
-/// A function subtracts an interval value to Timestamp, Date or DateTime, and return the result.
+/// A function subtracts an interval value to Timestamp, Date, and return the result.
+/// The implementation of datetime type is based on Date64 which is incorrect so this function
+/// doesn't support the datetime type.
#[derive(Clone, Debug, Default)]
pub struct DateSubFunction;
@@ -44,7 +45,6 @@ impl Function for DateSubFunction {
helper::one_of_sigs2(
vec![
ConcreteDataType::date_datatype(),
- ConcreteDataType::datetime_datatype(),
ConcreteDataType::timestamp_second_datatype(),
ConcreteDataType::timestamp_millisecond_datatype(),
ConcreteDataType::timestamp_microsecond_datatype(),
@@ -69,65 +69,14 @@ impl Function for DateSubFunction {
}
);
- let left = &columns[0];
- let right = &columns[1];
+ let left = columns[0].to_arrow_array();
+ let right = columns[1].to_arrow_array();
- let size = left.len();
- let left_datatype = columns[0].data_type();
-
- match left_datatype {
- ConcreteDataType::Timestamp(_) => {
- let mut result = left_datatype.create_mutable_vector(size);
- for i in 0..size {
- let ts = left.get(i).as_timestamp();
- let interval = right.get(i).as_interval();
-
- let new_ts = match (ts, interval) {
- (Some(ts), Some(interval)) => ts.sub_interval(interval),
- _ => ts,
- };
-
- result.push_value_ref(ValueRef::from(new_ts));
- }
-
- Ok(result.to_vector())
- }
- ConcreteDataType::Date(_) => {
- let mut result = left_datatype.create_mutable_vector(size);
- for i in 0..size {
- let date = left.get(i).as_date();
- let interval = right.get(i).as_interval();
- let new_date = match (date, interval) {
- (Some(date), Some(interval)) => date.sub_interval(interval),
- _ => date,
- };
-
- result.push_value_ref(ValueRef::from(new_date));
- }
-
- Ok(result.to_vector())
- }
- ConcreteDataType::DateTime(_) => {
- let mut result = left_datatype.create_mutable_vector(size);
- for i in 0..size {
- let datetime = left.get(i).as_datetime();
- let interval = right.get(i).as_interval();
- let new_datetime = match (datetime, interval) {
- (Some(datetime), Some(interval)) => datetime.sub_interval(interval),
- _ => datetime,
- };
-
- result.push_value_ref(ValueRef::from(new_datetime));
- }
-
- Ok(result.to_vector())
- }
- _ => UnsupportedInputDataTypeSnafu {
- function: NAME,
- datatypes: columns.iter().map(|c| c.data_type()).collect::>(),
- }
- .fail(),
- }
+ let result = numeric::sub(&left, &right).context(ArrowComputeSnafu)?;
+ let arrow_type = result.data_type().clone();
+ Helper::try_into_vector(result).context(IntoVectorSnafu {
+ data_type: arrow_type,
+ })
}
}
@@ -145,8 +94,7 @@ mod tests {
use datatypes::prelude::ConcreteDataType;
use datatypes::value::Value;
use datatypes::vectors::{
- DateTimeVector, DateVector, IntervalDayTimeVector, IntervalYearMonthVector,
- TimestampSecondVector,
+ DateVector, IntervalDayTimeVector, IntervalYearMonthVector, TimestampSecondVector,
};
use super::{DateSubFunction, *};
@@ -174,11 +122,15 @@ mod tests {
f.return_type(&[ConcreteDataType::datetime_datatype()])
.unwrap()
);
- assert!(matches!(f.signature(),
+ assert!(
+ matches!(f.signature(),
Signature {
type_signature: TypeSignature::OneOf(sigs),
volatility: Volatility::Immutable
- } if sigs.len() == 18));
+ } if sigs.len() == 15),
+ "{:?}",
+ f.signature()
+ );
}
#[test]
@@ -250,42 +202,4 @@ mod tests {
}
}
}
-
- #[test]
- fn test_datetime_date_sub() {
- let f = DateSubFunction;
- let millis_per_month = 3600 * 24 * 30 * 1000;
-
- let dates = vec![
- Some(123 * millis_per_month),
- None,
- Some(42 * millis_per_month),
- None,
- ];
- // Intervals in months
- let intervals = vec![1, 2, 3, 1];
- let results = [Some(316137600000), None, Some(100915200000), None];
-
- let date_vector = DateTimeVector::from(dates.clone());
- let interval_vector = IntervalYearMonthVector::from_vec(intervals);
- let args: Vec = vec![Arc::new(date_vector), Arc::new(interval_vector)];
- let vector = f.eval(FunctionContext::default(), &args).unwrap();
-
- assert_eq!(4, vector.len());
- for (i, _t) in dates.iter().enumerate() {
- let v = vector.get(i);
- let result = results.get(i).unwrap();
-
- if result.is_none() {
- assert_eq!(Value::Null, v);
- continue;
- }
- match v {
- Value::DateTime(date) => {
- assert_eq!(date.val(), result.unwrap());
- }
- _ => unreachable!(),
- }
- }
- }
}
diff --git a/src/common/function/src/scalars/geo.rs b/src/common/function/src/scalars/geo.rs
index 4b126f20f0..866acddc4d 100644
--- a/src/common/function/src/scalars/geo.rs
+++ b/src/common/function/src/scalars/geo.rs
@@ -13,11 +13,11 @@
// limitations under the License.
use std::sync::Arc;
+pub(crate) mod encoding;
mod geohash;
mod h3;
-
-use geohash::GeohashFunction;
-use h3::H3Function;
+mod helpers;
+mod s2;
use crate::function_registry::FunctionRegistry;
@@ -25,7 +25,40 @@ pub(crate) struct GeoFunctions;
impl GeoFunctions {
pub fn register(registry: &FunctionRegistry) {
- registry.register(Arc::new(GeohashFunction));
- registry.register(Arc::new(H3Function));
+ // geohash
+ registry.register(Arc::new(geohash::GeohashFunction));
+ registry.register(Arc::new(geohash::GeohashNeighboursFunction));
+
+ // h3 index
+ registry.register(Arc::new(h3::H3LatLngToCell));
+ registry.register(Arc::new(h3::H3LatLngToCellString));
+
+ // h3 index inspection
+ registry.register(Arc::new(h3::H3CellBase));
+ registry.register(Arc::new(h3::H3CellIsPentagon));
+ registry.register(Arc::new(h3::H3StringToCell));
+ registry.register(Arc::new(h3::H3CellToString));
+ registry.register(Arc::new(h3::H3CellCenterLatLng));
+ registry.register(Arc::new(h3::H3CellResolution));
+
+ // h3 hierarchical grid
+ registry.register(Arc::new(h3::H3CellCenterChild));
+ registry.register(Arc::new(h3::H3CellParent));
+ registry.register(Arc::new(h3::H3CellToChildren));
+ registry.register(Arc::new(h3::H3CellToChildrenSize));
+ registry.register(Arc::new(h3::H3CellToChildPos));
+ registry.register(Arc::new(h3::H3ChildPosToCell));
+
+ // h3 grid traversal
+ registry.register(Arc::new(h3::H3GridDisk));
+ registry.register(Arc::new(h3::H3GridDiskDistances));
+ registry.register(Arc::new(h3::H3GridDistance));
+ registry.register(Arc::new(h3::H3GridPathCells));
+
+ // s2
+ registry.register(Arc::new(s2::S2LatLngToCell));
+ registry.register(Arc::new(s2::S2CellLevel));
+ registry.register(Arc::new(s2::S2CellToToken));
+ registry.register(Arc::new(s2::S2CellParent));
}
}
diff --git a/src/common/function/src/scalars/geo/encoding.rs b/src/common/function/src/scalars/geo/encoding.rs
new file mode 100644
index 0000000000..145cd24bff
--- /dev/null
+++ b/src/common/function/src/scalars/geo/encoding.rs
@@ -0,0 +1,223 @@
+// Copyright 2023 Greptime Team
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+use std::sync::Arc;
+
+use common_error::ext::{BoxedError, PlainError};
+use common_error::status_code::StatusCode;
+use common_macro::{as_aggr_func_creator, AggrFuncTypeStore};
+use common_query::error::{self, InvalidInputStateSnafu, Result};
+use common_query::logical_plan::accumulator::AggrFuncTypeStore;
+use common_query::logical_plan::{Accumulator, AggregateFunctionCreator};
+use common_query::prelude::AccumulatorCreatorFunction;
+use common_time::Timestamp;
+use datatypes::prelude::ConcreteDataType;
+use datatypes::value::{ListValue, Value};
+use datatypes::vectors::VectorRef;
+use snafu::{ensure, ResultExt};
+
+use super::helpers::{ensure_columns_len, ensure_columns_n};
+
+/// Accumulator of lat, lng, timestamp tuples
+#[derive(Debug)]
+pub struct JsonPathAccumulator {
+ timestamp_type: ConcreteDataType,
+ lat: Vec>,
+ lng: Vec >,
+ timestamp: Vec >,
+}
+
+impl JsonPathAccumulator {
+ fn new(timestamp_type: ConcreteDataType) -> Self {
+ Self {
+ lat: Vec::default(),
+ lng: Vec::default(),
+ timestamp: Vec::default(),
+ timestamp_type,
+ }
+ }
+}
+
+impl Accumulator for JsonPathAccumulator {
+ fn state(&self) -> Result> {
+ Ok(vec![
+ Value::List(ListValue::new(
+ self.lat.iter().map(|i| Value::from(*i)).collect(),
+ ConcreteDataType::float64_datatype(),
+ )),
+ Value::List(ListValue::new(
+ self.lng.iter().map(|i| Value::from(*i)).collect(),
+ ConcreteDataType::float64_datatype(),
+ )),
+ Value::List(ListValue::new(
+ self.timestamp.iter().map(|i| Value::from(*i)).collect(),
+ self.timestamp_type.clone(),
+ )),
+ ])
+ }
+
+ fn update_batch(&mut self, columns: &[VectorRef]) -> Result<()> {
+ // update batch as in datafusion just provides the accumulator original
+ // input.
+ //
+ // columns is vec of [`lat`, `lng`, `timestamp`]
+ // where
+ // - `lat` is a vector of `Value::Float64` or similar type. Each item in
+ // the vector is a row in given dataset.
+ // - so on so forth for `lng` and `timestamp`
+ ensure_columns_n!(columns, 3);
+
+ let lat = &columns[0];
+ let lng = &columns[1];
+ let ts = &columns[2];
+
+ let size = lat.len();
+
+ for idx in 0..size {
+ self.lat.push(lat.get(idx).as_f64_lossy());
+ self.lng.push(lng.get(idx).as_f64_lossy());
+ self.timestamp.push(ts.get(idx).as_timestamp());
+ }
+
+ Ok(())
+ }
+
+ fn merge_batch(&mut self, states: &[VectorRef]) -> Result<()> {
+ // merge batch as in datafusion gives state accumulated from the data
+ // returned from child accumulators' state() call
+ // In our particular implementation, the data structure is like
+ //
+ // states is vec of [`lat`, `lng`, `timestamp`]
+ // where
+ // - `lat` is a vector of `Value::List`. Each item in the list is all
+ // coordinates from a child accumulator.
+ // - so on so forth for `lng` and `timestamp`
+
+ ensure_columns_n!(states, 3);
+
+ let lat_lists = &states[0];
+ let lng_lists = &states[1];
+ let ts_lists = &states[2];
+
+ let len = lat_lists.len();
+
+ for idx in 0..len {
+ if let Some(lat_list) = lat_lists
+ .get(idx)
+ .as_list()
+ .map_err(BoxedError::new)
+ .context(error::ExecuteSnafu)?
+ {
+ for v in lat_list.items() {
+ self.lat.push(v.as_f64_lossy());
+ }
+ }
+
+ if let Some(lng_list) = lng_lists
+ .get(idx)
+ .as_list()
+ .map_err(BoxedError::new)
+ .context(error::ExecuteSnafu)?
+ {
+ for v in lng_list.items() {
+ self.lng.push(v.as_f64_lossy());
+ }
+ }
+
+ if let Some(ts_list) = ts_lists
+ .get(idx)
+ .as_list()
+ .map_err(BoxedError::new)
+ .context(error::ExecuteSnafu)?
+ {
+ for v in ts_list.items() {
+ self.timestamp.push(v.as_timestamp());
+ }
+ }
+ }
+
+ Ok(())
+ }
+
+ fn evaluate(&self) -> Result {
+ let mut work_vec: Vec<(&Option, &Option, &Option)> = self
+ .lat
+ .iter()
+ .zip(self.lng.iter())
+ .zip(self.timestamp.iter())
+ .map(|((a, b), c)| (a, b, c))
+ .collect();
+
+ // sort by timestamp, we treat null timestamp as 0
+ work_vec.sort_unstable_by_key(|tuple| tuple.2.unwrap_or_else(|| Timestamp::new_second(0)));
+
+ let result = serde_json::to_string(
+ &work_vec
+ .into_iter()
+ // note that we transform to lng,lat for geojson compatibility
+ .map(|(lat, lng, _)| vec![lng, lat])
+ .collect::>>>(),
+ )
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("Serialization failure: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)?;
+
+ Ok(Value::String(result.into()))
+ }
+}
+
+/// This function accept rows of lat, lng and timestamp, sort with timestamp and
+/// encoding them into a geojson-like path.
+///
+/// Example:
+///
+/// ```sql
+/// SELECT json_encode_path(lat, lon, timestamp) FROM table [group by ...];
+/// ```
+///
+#[as_aggr_func_creator]
+#[derive(Debug, Default, AggrFuncTypeStore)]
+pub struct JsonPathEncodeFunctionCreator {}
+
+impl AggregateFunctionCreator for JsonPathEncodeFunctionCreator {
+ fn creator(&self) -> AccumulatorCreatorFunction {
+ let creator: AccumulatorCreatorFunction = Arc::new(move |types: &[ConcreteDataType]| {
+ let ts_type = types[2].clone();
+ Ok(Box::new(JsonPathAccumulator::new(ts_type)))
+ });
+
+ creator
+ }
+
+ fn output_type(&self) -> Result {
+ Ok(ConcreteDataType::string_datatype())
+ }
+
+ fn state_types(&self) -> Result> {
+ let input_types = self.input_types()?;
+ ensure!(input_types.len() == 3, InvalidInputStateSnafu);
+
+ let timestamp_type = input_types[2].clone();
+
+ Ok(vec![
+ ConcreteDataType::list_datatype(ConcreteDataType::float64_datatype()),
+ ConcreteDataType::list_datatype(ConcreteDataType::float64_datatype()),
+ ConcreteDataType::list_datatype(timestamp_type),
+ ])
+ }
+}
diff --git a/src/common/function/src/scalars/geo/geohash.rs b/src/common/function/src/scalars/geo/geohash.rs
index 2daa8223cc..d35a6a06ff 100644
--- a/src/common/function/src/scalars/geo/geohash.rs
+++ b/src/common/function/src/scalars/geo/geohash.rs
@@ -20,23 +20,69 @@ use common_query::error::{self, InvalidFuncArgsSnafu, Result};
use common_query::prelude::{Signature, TypeSignature};
use datafusion::logical_expr::Volatility;
use datatypes::prelude::ConcreteDataType;
-use datatypes::scalars::ScalarVectorBuilder;
-use datatypes::value::Value;
-use datatypes::vectors::{MutableVector, StringVectorBuilder, VectorRef};
+use datatypes::scalars::{Scalar, ScalarVectorBuilder};
+use datatypes::value::{ListValue, Value};
+use datatypes::vectors::{ListVectorBuilder, MutableVector, StringVectorBuilder, VectorRef};
use geohash::Coord;
use snafu::{ensure, ResultExt};
use crate::function::{Function, FunctionContext};
+macro_rules! ensure_resolution_usize {
+ ($v: ident) => {
+ if !($v > 0 && $v <= 12) {
+ Err(BoxedError::new(PlainError::new(
+ format!("Invalid geohash resolution {}, expect value: [1, 12]", $v),
+ StatusCode::EngineExecuteQuery,
+ )))
+ .context(error::ExecuteSnafu)
+ } else {
+ Ok($v as usize)
+ }
+ };
+}
+
+fn try_into_resolution(v: Value) -> Result {
+ match v {
+ Value::Int8(v) => {
+ ensure_resolution_usize!(v)
+ }
+ Value::Int16(v) => {
+ ensure_resolution_usize!(v)
+ }
+ Value::Int32(v) => {
+ ensure_resolution_usize!(v)
+ }
+ Value::Int64(v) => {
+ ensure_resolution_usize!(v)
+ }
+ Value::UInt8(v) => {
+ ensure_resolution_usize!(v)
+ }
+ Value::UInt16(v) => {
+ ensure_resolution_usize!(v)
+ }
+ Value::UInt32(v) => {
+ ensure_resolution_usize!(v)
+ }
+ Value::UInt64(v) => {
+ ensure_resolution_usize!(v)
+ }
+ _ => unreachable!(),
+ }
+}
+
/// Function that return geohash string for a given geospatial coordinate.
#[derive(Clone, Debug, Default)]
pub struct GeohashFunction;
-const NAME: &str = "geohash";
+impl GeohashFunction {
+ const NAME: &'static str = "geohash";
+}
impl Function for GeohashFunction {
fn name(&self) -> &str {
- NAME
+ Self::NAME
}
fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
@@ -93,17 +139,7 @@ impl Function for GeohashFunction {
for i in 0..size {
let lat = lat_vec.get(i).as_f64_lossy();
let lon = lon_vec.get(i).as_f64_lossy();
- let r = match resolution_vec.get(i) {
- Value::Int8(v) => v as usize,
- Value::Int16(v) => v as usize,
- Value::Int32(v) => v as usize,
- Value::Int64(v) => v as usize,
- Value::UInt8(v) => v as usize,
- Value::UInt16(v) => v as usize,
- Value::UInt32(v) => v as usize,
- Value::UInt64(v) => v as usize,
- _ => unreachable!(),
- };
+ let r = try_into_resolution(resolution_vec.get(i))?;
let result = match (lat, lon) {
(Some(lat), Some(lon)) => {
@@ -130,6 +166,134 @@ impl Function for GeohashFunction {
impl fmt::Display for GeohashFunction {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{}", NAME)
+ write!(f, "{}", Self::NAME)
+ }
+}
+
+/// Function that return geohash string for a given geospatial coordinate.
+#[derive(Clone, Debug, Default)]
+pub struct GeohashNeighboursFunction;
+
+impl GeohashNeighboursFunction {
+ const NAME: &'static str = "geohash_neighbours";
+}
+
+impl Function for GeohashNeighboursFunction {
+ fn name(&self) -> &str {
+ GeohashNeighboursFunction::NAME
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::list_datatype(
+ ConcreteDataType::string_datatype(),
+ ))
+ }
+
+ fn signature(&self) -> Signature {
+ let mut signatures = Vec::new();
+ for coord_type in &[
+ ConcreteDataType::float32_datatype(),
+ ConcreteDataType::float64_datatype(),
+ ] {
+ for resolution_type in &[
+ ConcreteDataType::int8_datatype(),
+ ConcreteDataType::int16_datatype(),
+ ConcreteDataType::int32_datatype(),
+ ConcreteDataType::int64_datatype(),
+ ConcreteDataType::uint8_datatype(),
+ ConcreteDataType::uint16_datatype(),
+ ConcreteDataType::uint32_datatype(),
+ ConcreteDataType::uint64_datatype(),
+ ] {
+ signatures.push(TypeSignature::Exact(vec![
+ // latitude
+ coord_type.clone(),
+ // longitude
+ coord_type.clone(),
+ // resolution
+ resolution_type.clone(),
+ ]));
+ }
+ }
+ Signature::one_of(signatures, Volatility::Stable)
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure!(
+ columns.len() == 3,
+ InvalidFuncArgsSnafu {
+ err_msg: format!(
+ "The length of the args is not correct, expect 3, provided : {}",
+ columns.len()
+ ),
+ }
+ );
+
+ let lat_vec = &columns[0];
+ let lon_vec = &columns[1];
+ let resolution_vec = &columns[2];
+
+ let size = lat_vec.len();
+ let mut results =
+ ListVectorBuilder::with_type_capacity(ConcreteDataType::string_datatype(), size);
+
+ for i in 0..size {
+ let lat = lat_vec.get(i).as_f64_lossy();
+ let lon = lon_vec.get(i).as_f64_lossy();
+ let r = try_into_resolution(resolution_vec.get(i))?;
+
+ let result = match (lat, lon) {
+ (Some(lat), Some(lon)) => {
+ let coord = Coord { x: lon, y: lat };
+ let encoded = geohash::encode(coord, r)
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("Geohash error: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)?;
+ let neighbours = geohash::neighbors(&encoded)
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("Geohash error: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)?;
+ Some(ListValue::new(
+ vec![
+ neighbours.n,
+ neighbours.nw,
+ neighbours.w,
+ neighbours.sw,
+ neighbours.s,
+ neighbours.se,
+ neighbours.e,
+ neighbours.ne,
+ ]
+ .into_iter()
+ .map(Value::from)
+ .collect(),
+ ConcreteDataType::string_datatype(),
+ ))
+ }
+ _ => None,
+ };
+
+ if let Some(list_value) = result {
+ results.push(Some(list_value.as_scalar_ref()));
+ } else {
+ results.push(None);
+ }
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+impl fmt::Display for GeohashNeighboursFunction {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "{}", GeohashNeighboursFunction::NAME)
}
}
diff --git a/src/common/function/src/scalars/geo/h3.rs b/src/common/function/src/scalars/geo/h3.rs
index 26ec246997..7f98c3147a 100644
--- a/src/common/function/src/scalars/geo/h3.rs
+++ b/src/common/function/src/scalars/geo/h3.rs
@@ -12,55 +12,99 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-use std::fmt;
+use std::str::FromStr;
use common_error::ext::{BoxedError, PlainError};
use common_error::status_code::StatusCode;
-use common_query::error::{self, InvalidFuncArgsSnafu, Result};
+use common_query::error::{self, Result};
use common_query::prelude::{Signature, TypeSignature};
use datafusion::logical_expr::Volatility;
use datatypes::prelude::ConcreteDataType;
-use datatypes::scalars::ScalarVectorBuilder;
-use datatypes::value::Value;
-use datatypes::vectors::{MutableVector, StringVectorBuilder, VectorRef};
-use h3o::{LatLng, Resolution};
-use snafu::{ensure, ResultExt};
+use datatypes::scalars::{Scalar, ScalarVectorBuilder};
+use datatypes::value::{ListValue, Value};
+use datatypes::vectors::{
+ BooleanVectorBuilder, Int32VectorBuilder, ListVectorBuilder, MutableVector,
+ StringVectorBuilder, UInt64VectorBuilder, UInt8VectorBuilder, VectorRef,
+};
+use derive_more::Display;
+use h3o::{CellIndex, LatLng, Resolution};
+use once_cell::sync::Lazy;
+use snafu::ResultExt;
+use super::helpers::{ensure_and_coerce, ensure_columns_len, ensure_columns_n};
use crate::function::{Function, FunctionContext};
-/// Function that returns [h3] encoding string for a given geospatial coordinate.
+static CELL_TYPES: Lazy> = Lazy::new(|| {
+ vec![
+ ConcreteDataType::int64_datatype(),
+ ConcreteDataType::uint64_datatype(),
+ ]
+});
+
+static COORDINATE_TYPES: Lazy> = Lazy::new(|| {
+ vec![
+ ConcreteDataType::float32_datatype(),
+ ConcreteDataType::float64_datatype(),
+ ]
+});
+static RESOLUTION_TYPES: Lazy> = Lazy::new(|| {
+ vec![
+ ConcreteDataType::int8_datatype(),
+ ConcreteDataType::int16_datatype(),
+ ConcreteDataType::int32_datatype(),
+ ConcreteDataType::int64_datatype(),
+ ConcreteDataType::uint8_datatype(),
+ ConcreteDataType::uint16_datatype(),
+ ConcreteDataType::uint32_datatype(),
+ ConcreteDataType::uint64_datatype(),
+ ]
+});
+static DISTANCE_TYPES: Lazy> = Lazy::new(|| {
+ vec![
+ ConcreteDataType::int8_datatype(),
+ ConcreteDataType::int16_datatype(),
+ ConcreteDataType::int32_datatype(),
+ ConcreteDataType::int64_datatype(),
+ ConcreteDataType::uint8_datatype(),
+ ConcreteDataType::uint16_datatype(),
+ ConcreteDataType::uint32_datatype(),
+ ConcreteDataType::uint64_datatype(),
+ ]
+});
+
+static POSITION_TYPES: Lazy> = Lazy::new(|| {
+ vec![
+ ConcreteDataType::int8_datatype(),
+ ConcreteDataType::int16_datatype(),
+ ConcreteDataType::int32_datatype(),
+ ConcreteDataType::int64_datatype(),
+ ConcreteDataType::uint8_datatype(),
+ ConcreteDataType::uint16_datatype(),
+ ConcreteDataType::uint32_datatype(),
+ ConcreteDataType::uint64_datatype(),
+ ]
+});
+
+/// Function that returns [h3] encoding cellid for a given geospatial coordinate.
///
/// [h3]: https://h3geo.org/
-#[derive(Clone, Debug, Default)]
-pub struct H3Function;
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3LatLngToCell;
-const NAME: &str = "h3";
-
-impl Function for H3Function {
+impl Function for H3LatLngToCell {
fn name(&self) -> &str {
- NAME
+ "h3_latlng_to_cell"
}
fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
- Ok(ConcreteDataType::string_datatype())
+ Ok(ConcreteDataType::uint64_datatype())
}
fn signature(&self) -> Signature {
let mut signatures = Vec::new();
- for coord_type in &[
- ConcreteDataType::float32_datatype(),
- ConcreteDataType::float64_datatype(),
- ] {
- for resolution_type in &[
- ConcreteDataType::int8_datatype(),
- ConcreteDataType::int16_datatype(),
- ConcreteDataType::int32_datatype(),
- ConcreteDataType::int64_datatype(),
- ConcreteDataType::uint8_datatype(),
- ConcreteDataType::uint16_datatype(),
- ConcreteDataType::uint32_datatype(),
- ConcreteDataType::uint64_datatype(),
- ] {
+ for coord_type in COORDINATE_TYPES.as_slice() {
+ for resolution_type in RESOLUTION_TYPES.as_slice() {
signatures.push(TypeSignature::Exact(vec![
// latitude
coord_type.clone(),
@@ -75,37 +119,19 @@ impl Function for H3Function {
}
fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
- ensure!(
- columns.len() == 3,
- InvalidFuncArgsSnafu {
- err_msg: format!(
- "The length of the args is not correct, expect 3, provided : {}",
- columns.len()
- ),
- }
- );
+ ensure_columns_n!(columns, 3);
let lat_vec = &columns[0];
let lon_vec = &columns[1];
let resolution_vec = &columns[2];
let size = lat_vec.len();
- let mut results = StringVectorBuilder::with_capacity(size);
+ let mut results = UInt64VectorBuilder::with_capacity(size);
for i in 0..size {
let lat = lat_vec.get(i).as_f64_lossy();
let lon = lon_vec.get(i).as_f64_lossy();
- let r = match resolution_vec.get(i) {
- Value::Int8(v) => v as u8,
- Value::Int16(v) => v as u8,
- Value::Int32(v) => v as u8,
- Value::Int64(v) => v as u8,
- Value::UInt8(v) => v,
- Value::UInt16(v) => v as u8,
- Value::UInt32(v) => v as u8,
- Value::UInt64(v) => v as u8,
- _ => unreachable!(),
- };
+ let r = value_to_resolution(resolution_vec.get(i))?;
let result = match (lat, lon) {
(Some(lat), Some(lon)) => {
@@ -117,7 +143,71 @@ impl Function for H3Function {
))
})
.context(error::ExecuteSnafu)?;
- let r = Resolution::try_from(r)
+ let encoded: u64 = coord.to_cell(r).into();
+ Some(encoded)
+ }
+ _ => None,
+ };
+
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns [h3] encoding cellid in string form for a given
+/// geospatial coordinate.
+///
+/// [h3]: https://h3geo.org/
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3LatLngToCellString;
+
+impl Function for H3LatLngToCellString {
+ fn name(&self) -> &str {
+ "h3_latlng_to_cell_string"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::string_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ let mut signatures = Vec::new();
+ for coord_type in COORDINATE_TYPES.as_slice() {
+ for resolution_type in RESOLUTION_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![
+ // latitude
+ coord_type.clone(),
+ // longitude
+ coord_type.clone(),
+ // resolution
+ resolution_type.clone(),
+ ]));
+ }
+ }
+ Signature::one_of(signatures, Volatility::Stable)
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 3);
+
+ let lat_vec = &columns[0];
+ let lon_vec = &columns[1];
+ let resolution_vec = &columns[2];
+
+ let size = lat_vec.len();
+ let mut results = StringVectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let lat = lat_vec.get(i).as_f64_lossy();
+ let lon = lon_vec.get(i).as_f64_lossy();
+ let r = value_to_resolution(resolution_vec.get(i))?;
+
+ let result = match (lat, lon) {
+ (Some(lat), Some(lon)) => {
+ let coord = LatLng::new(lat, lon)
.map_err(|e| {
BoxedError::new(PlainError::new(
format!("H3 error: {}", e),
@@ -138,8 +228,852 @@ impl Function for H3Function {
}
}
-impl fmt::Display for H3Function {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{}", NAME)
+/// Function that converts cell id to its string form
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellToString;
+
+impl Function for H3CellToString {
+ fn name(&self) -> &str {
+ "h3_cell_to_string"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::string_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 1);
+
+ let cell_vec = &columns[0];
+ let size = cell_vec.len();
+ let mut results = StringVectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell_id_string = cell_from_value(cell_vec.get(i))?.map(|c| c.to_string());
+
+ results.push(cell_id_string.as_deref());
+ }
+
+ Ok(results.to_vector())
}
}
+
+/// Function that converts cell string id to uint64 number
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3StringToCell;
+
+impl Function for H3StringToCell {
+ fn name(&self) -> &str {
+ "h3_string_to_cell"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ Signature::new(
+ TypeSignature::Exact(vec![ConcreteDataType::string_datatype()]),
+ Volatility::Stable,
+ )
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 1);
+
+ let string_vec = &columns[0];
+ let size = string_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = string_vec.get(i);
+
+ let cell_id = match cell {
+ Value::String(v) => Some(
+ CellIndex::from_str(v.as_utf8())
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("H3 error: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)?
+ .into(),
+ ),
+ _ => None,
+ };
+
+ results.push(cell_id);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns centroid latitude and longitude of given cell id
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellCenterLatLng;
+
+impl Function for H3CellCenterLatLng {
+ fn name(&self) -> &str {
+ "h3_cell_center_latlng"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::list_datatype(
+ ConcreteDataType::float64_datatype(),
+ ))
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 1);
+
+ let cell_vec = &columns[0];
+ let size = cell_vec.len();
+ let mut results =
+ ListVectorBuilder::with_type_capacity(ConcreteDataType::float64_datatype(), size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let latlng = cell.map(LatLng::from);
+
+ if let Some(latlng) = latlng {
+ let result = ListValue::new(
+ vec![latlng.lat().into(), latlng.lng().into()],
+ ConcreteDataType::float64_datatype(),
+ );
+ results.push(Some(result.as_scalar_ref()));
+ } else {
+ results.push(None);
+ }
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns resolution of given cell id
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellResolution;
+
+impl Function for H3CellResolution {
+ fn name(&self) -> &str {
+ "h3_cell_resolution"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint8_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 1);
+
+ let cell_vec = &columns[0];
+ let size = cell_vec.len();
+ let mut results = UInt8VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let res = cell.map(|cell| cell.resolution().into());
+
+ results.push(res);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns base cell of given cell id
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellBase;
+
+impl Function for H3CellBase {
+ fn name(&self) -> &str {
+ "h3_cell_base"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint8_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 1);
+
+ let cell_vec = &columns[0];
+ let size = cell_vec.len();
+ let mut results = UInt8VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let res = cell.map(|cell| cell.base_cell().into());
+
+ results.push(res);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that check if given cell id is a pentagon
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellIsPentagon;
+
+impl Function for H3CellIsPentagon {
+ fn name(&self) -> &str {
+ "h3_cell_is_pentagon"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::boolean_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 1);
+
+ let cell_vec = &columns[0];
+ let size = cell_vec.len();
+ let mut results = BooleanVectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let res = cell.map(|cell| cell.is_pentagon());
+
+ results.push(res);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns center child cell of given cell id
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellCenterChild;
+
+impl Function for H3CellCenterChild {
+ fn name(&self) -> &str {
+ "h3_cell_center_child"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell_and_resolution()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_vec = &columns[0];
+ let res_vec = &columns[1];
+ let size = cell_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let res = value_to_resolution(res_vec.get(i))?;
+ let result = cell
+ .and_then(|cell| cell.center_child(res))
+ .map(|c| c.into());
+
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns parent cell of given cell id and resolution
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellParent;
+
+impl Function for H3CellParent {
+ fn name(&self) -> &str {
+ "h3_cell_parent"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell_and_resolution()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_vec = &columns[0];
+ let res_vec = &columns[1];
+ let size = cell_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let res = value_to_resolution(res_vec.get(i))?;
+ let result = cell.and_then(|cell| cell.parent(res)).map(|c| c.into());
+
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns children cell list
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellToChildren;
+
+impl Function for H3CellToChildren {
+ fn name(&self) -> &str {
+ "h3_cell_to_children"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::list_datatype(
+ ConcreteDataType::uint64_datatype(),
+ ))
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell_and_resolution()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_vec = &columns[0];
+ let res_vec = &columns[1];
+ let size = cell_vec.len();
+ let mut results =
+ ListVectorBuilder::with_type_capacity(ConcreteDataType::uint64_datatype(), size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let res = value_to_resolution(res_vec.get(i))?;
+ let result = cell.map(|cell| {
+ let children: Vec = cell
+ .children(res)
+ .map(|child| Value::from(u64::from(child)))
+ .collect();
+ ListValue::new(children, ConcreteDataType::uint64_datatype())
+ });
+
+ if let Some(list_value) = result {
+ results.push(Some(list_value.as_scalar_ref()));
+ } else {
+ results.push(None);
+ }
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns children cell count
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellToChildrenSize;
+
+impl Function for H3CellToChildrenSize {
+ fn name(&self) -> &str {
+ "h3_cell_to_children_size"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell_and_resolution()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_vec = &columns[0];
+ let res_vec = &columns[1];
+ let size = cell_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let res = value_to_resolution(res_vec.get(i))?;
+ let result = cell.map(|cell| cell.children_count(res));
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns the cell position if its parent at given resolution
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3CellToChildPos;
+
+impl Function for H3CellToChildPos {
+ fn name(&self) -> &str {
+ "h3_cell_to_child_pos"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell_and_resolution()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_vec = &columns[0];
+ let res_vec = &columns[1];
+ let size = cell_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let res = value_to_resolution(res_vec.get(i))?;
+ let result = cell.and_then(|cell| cell.child_position(res));
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns the cell at given position of the parent at given resolution
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3ChildPosToCell;
+
+impl Function for H3ChildPosToCell {
+ fn name(&self) -> &str {
+ "h3_child_pos_to_cell"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ let mut signatures =
+ Vec::with_capacity(POSITION_TYPES.len() * CELL_TYPES.len() * RESOLUTION_TYPES.len());
+ for position_type in POSITION_TYPES.as_slice() {
+ for cell_type in CELL_TYPES.as_slice() {
+ for resolution_type in RESOLUTION_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![
+ position_type.clone(),
+ cell_type.clone(),
+ resolution_type.clone(),
+ ]));
+ }
+ }
+ }
+ Signature::one_of(signatures, Volatility::Stable)
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 3);
+
+ let pos_vec = &columns[0];
+ let cell_vec = &columns[1];
+ let res_vec = &columns[2];
+ let size = cell_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let pos = value_to_position(pos_vec.get(i))?;
+ let res = value_to_resolution(res_vec.get(i))?;
+ let result = cell.and_then(|cell| cell.child_at(pos, res).map(u64::from));
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns cells with k distances of given cell
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3GridDisk;
+
+impl Function for H3GridDisk {
+ fn name(&self) -> &str {
+ "h3_grid_disk"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::list_datatype(
+ ConcreteDataType::uint64_datatype(),
+ ))
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell_and_distance()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_vec = &columns[0];
+ let k_vec = &columns[1];
+ let size = cell_vec.len();
+ let mut results =
+ ListVectorBuilder::with_type_capacity(ConcreteDataType::uint64_datatype(), size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let k = value_to_distance(k_vec.get(i))?;
+
+ let result = cell.map(|cell| {
+ let children: Vec = cell
+ .grid_disk::>(k)
+ .into_iter()
+ .map(|child| Value::from(u64::from(child)))
+ .collect();
+ ListValue::new(children, ConcreteDataType::uint64_datatype())
+ });
+
+ if let Some(list_value) = result {
+ results.push(Some(list_value.as_scalar_ref()));
+ } else {
+ results.push(None);
+ }
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns all cells within k distances of given cell
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3GridDiskDistances;
+
+impl Function for H3GridDiskDistances {
+ fn name(&self) -> &str {
+ "h3_grid_disk_distances"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::list_datatype(
+ ConcreteDataType::uint64_datatype(),
+ ))
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell_and_distance()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_vec = &columns[0];
+ let k_vec = &columns[1];
+ let size = cell_vec.len();
+ let mut results =
+ ListVectorBuilder::with_type_capacity(ConcreteDataType::uint64_datatype(), size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i))?;
+ let k = value_to_distance(k_vec.get(i))?;
+
+ let result = cell.map(|cell| {
+ let children: Vec = cell
+ .grid_disk_distances::>(k)
+ .into_iter()
+ .map(|(child, _distance)| Value::from(u64::from(child)))
+ .collect();
+ ListValue::new(children, ConcreteDataType::uint64_datatype())
+ });
+
+ if let Some(list_value) = result {
+ results.push(Some(list_value.as_scalar_ref()));
+ } else {
+ results.push(None);
+ }
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns distance between two cells
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3GridDistance;
+
+impl Function for H3GridDistance {
+ fn name(&self) -> &str {
+ "h3_grid_distance"
+ }
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::int32_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_double_cells()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_this_vec = &columns[0];
+ let cell_that_vec = &columns[1];
+ let size = cell_this_vec.len();
+
+ let mut results = Int32VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let result = match (
+ cell_from_value(cell_this_vec.get(i))?,
+ cell_from_value(cell_that_vec.get(i))?,
+ ) {
+ (Some(cell_this), Some(cell_that)) => {
+ let dist = cell_this
+ .grid_distance(cell_that)
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("H3 error: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)?;
+ Some(dist)
+ }
+ _ => None,
+ };
+
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Function that returns path cells between two cells
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct H3GridPathCells;
+
+impl Function for H3GridPathCells {
+ fn name(&self) -> &str {
+ "h3_grid_path_cells"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::list_datatype(
+ ConcreteDataType::uint64_datatype(),
+ ))
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_double_cells()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_this_vec = &columns[0];
+ let cell_that_vec = &columns[1];
+ let size = cell_this_vec.len();
+ let mut results =
+ ListVectorBuilder::with_type_capacity(ConcreteDataType::uint64_datatype(), size);
+
+ for i in 0..size {
+ let result = match (
+ cell_from_value(cell_this_vec.get(i))?,
+ cell_from_value(cell_that_vec.get(i))?,
+ ) {
+ (Some(cell_this), Some(cell_that)) => {
+ let cells = cell_this
+ .grid_path_cells(cell_that)
+ .and_then(|x| x.collect::, _>>())
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("H3 error: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)?;
+ Some(ListValue::new(
+ cells
+ .into_iter()
+ .map(|c| Value::from(u64::from(c)))
+ .collect(),
+ ConcreteDataType::uint64_datatype(),
+ ))
+ }
+ _ => None,
+ };
+
+ if let Some(list_value) = result {
+ results.push(Some(list_value.as_scalar_ref()));
+ } else {
+ results.push(None);
+ }
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+fn value_to_resolution(v: Value) -> Result {
+ let r = match v {
+ Value::Int8(v) => v as u8,
+ Value::Int16(v) => v as u8,
+ Value::Int32(v) => v as u8,
+ Value::Int64(v) => v as u8,
+ Value::UInt8(v) => v,
+ Value::UInt16(v) => v as u8,
+ Value::UInt32(v) => v as u8,
+ Value::UInt64(v) => v as u8,
+ _ => unreachable!(),
+ };
+ Resolution::try_from(r)
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("H3 error: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)
+}
+
+fn value_to_position(v: Value) -> Result {
+ match v {
+ Value::Int8(v) => ensure_and_coerce!(v >= 0, v as u64),
+ Value::Int16(v) => ensure_and_coerce!(v >= 0, v as u64),
+ Value::Int32(v) => ensure_and_coerce!(v >= 0, v as u64),
+ Value::Int64(v) => ensure_and_coerce!(v >= 0, v as u64),
+ Value::UInt8(v) => Ok(v as u64),
+ Value::UInt16(v) => Ok(v as u64),
+ Value::UInt32(v) => Ok(v as u64),
+ Value::UInt64(v) => Ok(v),
+ _ => unreachable!(),
+ }
+}
+
+fn value_to_distance(v: Value) -> Result {
+ match v {
+ Value::Int8(v) => ensure_and_coerce!(v >= 0, v as u32),
+ Value::Int16(v) => ensure_and_coerce!(v >= 0, v as u32),
+ Value::Int32(v) => ensure_and_coerce!(v >= 0, v as u32),
+ Value::Int64(v) => ensure_and_coerce!(v >= 0, v as u32),
+ Value::UInt8(v) => Ok(v as u32),
+ Value::UInt16(v) => Ok(v as u32),
+ Value::UInt32(v) => Ok(v),
+ Value::UInt64(v) => Ok(v as u32),
+ _ => unreachable!(),
+ }
+}
+
+fn signature_of_cell() -> Signature {
+ let mut signatures = Vec::with_capacity(CELL_TYPES.len());
+ for cell_type in CELL_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![cell_type.clone()]));
+ }
+
+ Signature::one_of(signatures, Volatility::Stable)
+}
+
+fn signature_of_double_cells() -> Signature {
+ let mut signatures = Vec::with_capacity(CELL_TYPES.len() * CELL_TYPES.len());
+ for cell_type in CELL_TYPES.as_slice() {
+ for cell_type2 in CELL_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![
+ cell_type.clone(),
+ cell_type2.clone(),
+ ]));
+ }
+ }
+
+ Signature::one_of(signatures, Volatility::Stable)
+}
+
+fn signature_of_cell_and_resolution() -> Signature {
+ let mut signatures = Vec::with_capacity(CELL_TYPES.len() * RESOLUTION_TYPES.len());
+ for cell_type in CELL_TYPES.as_slice() {
+ for resolution_type in RESOLUTION_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![
+ cell_type.clone(),
+ resolution_type.clone(),
+ ]));
+ }
+ }
+ Signature::one_of(signatures, Volatility::Stable)
+}
+
+fn signature_of_cell_and_distance() -> Signature {
+ let mut signatures = Vec::with_capacity(CELL_TYPES.len() * DISTANCE_TYPES.len());
+ for cell_type in CELL_TYPES.as_slice() {
+ for distance_type in DISTANCE_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![
+ cell_type.clone(),
+ distance_type.clone(),
+ ]));
+ }
+ }
+ Signature::one_of(signatures, Volatility::Stable)
+}
+
+fn cell_from_value(v: Value) -> Result> {
+ let cell = match v {
+ Value::Int64(v) => Some(
+ CellIndex::try_from(v as u64)
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("H3 error: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)?,
+ ),
+ Value::UInt64(v) => Some(
+ CellIndex::try_from(v)
+ .map_err(|e| {
+ BoxedError::new(PlainError::new(
+ format!("H3 error: {}", e),
+ StatusCode::EngineExecuteQuery,
+ ))
+ })
+ .context(error::ExecuteSnafu)?,
+ ),
+ _ => None,
+ };
+ Ok(cell)
+}
diff --git a/src/common/function/src/scalars/geo/helpers.rs b/src/common/function/src/scalars/geo/helpers.rs
new file mode 100644
index 0000000000..22d47f54e4
--- /dev/null
+++ b/src/common/function/src/scalars/geo/helpers.rs
@@ -0,0 +1,75 @@
+// Copyright 2023 Greptime Team
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+macro_rules! ensure_columns_len {
+ ($columns:ident) => {
+ snafu::ensure!(
+ $columns.windows(2).all(|c| c[0].len() == c[1].len()),
+ common_query::error::InvalidFuncArgsSnafu {
+ err_msg: "The length of input columns are in different size"
+ }
+ )
+ };
+ ($column_a:ident, $column_b:ident, $($column_n:ident),*) => {
+ snafu::ensure!(
+ {
+ let mut result = $column_a.len() == $column_b.len();
+ $(
+ result = result && ($column_a.len() == $column_n.len());
+ )*
+ result
+ }
+ common_query::error::InvalidFuncArgsSnafu {
+ err_msg: "The length of input columns are in different size"
+ }
+ )
+ };
+}
+
+pub(super) use ensure_columns_len;
+
+macro_rules! ensure_columns_n {
+ ($columns:ident, $n:literal) => {
+ snafu::ensure!(
+ $columns.len() == $n,
+ common_query::error::InvalidFuncArgsSnafu {
+ err_msg: format!(
+ "The length of arguments is not correct, expect {}, provided : {}",
+ stringify!($n),
+ $columns.len()
+ ),
+ }
+ );
+
+ if $n > 1 {
+ ensure_columns_len!($columns);
+ }
+ };
+}
+
+pub(super) use ensure_columns_n;
+
+macro_rules! ensure_and_coerce {
+ ($compare:expr, $coerce:expr) => {{
+ snafu::ensure!(
+ $compare,
+ common_query::error::InvalidFuncArgsSnafu {
+ err_msg: "Argument was outside of acceptable range "
+ }
+ );
+ Ok($coerce)
+ }};
+}
+
+pub(super) use ensure_and_coerce;
diff --git a/src/common/function/src/scalars/geo/s2.rs b/src/common/function/src/scalars/geo/s2.rs
new file mode 100644
index 0000000000..6e40dc300f
--- /dev/null
+++ b/src/common/function/src/scalars/geo/s2.rs
@@ -0,0 +1,275 @@
+// Copyright 2023 Greptime Team
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+use common_query::error::{InvalidFuncArgsSnafu, Result};
+use common_query::prelude::{Signature, TypeSignature};
+use datafusion::logical_expr::Volatility;
+use datatypes::prelude::ConcreteDataType;
+use datatypes::scalars::ScalarVectorBuilder;
+use datatypes::value::Value;
+use datatypes::vectors::{MutableVector, StringVectorBuilder, UInt64VectorBuilder, VectorRef};
+use derive_more::Display;
+use once_cell::sync::Lazy;
+use s2::cellid::{CellID, MAX_LEVEL};
+use s2::latlng::LatLng;
+use snafu::ensure;
+
+use crate::function::{Function, FunctionContext};
+use crate::scalars::geo::helpers::{ensure_and_coerce, ensure_columns_len, ensure_columns_n};
+
+static CELL_TYPES: Lazy> = Lazy::new(|| {
+ vec![
+ ConcreteDataType::int64_datatype(),
+ ConcreteDataType::uint64_datatype(),
+ ]
+});
+
+static COORDINATE_TYPES: Lazy> = Lazy::new(|| {
+ vec![
+ ConcreteDataType::float32_datatype(),
+ ConcreteDataType::float64_datatype(),
+ ]
+});
+
+static LEVEL_TYPES: Lazy> = Lazy::new(|| {
+ vec![
+ ConcreteDataType::int8_datatype(),
+ ConcreteDataType::int16_datatype(),
+ ConcreteDataType::int32_datatype(),
+ ConcreteDataType::int64_datatype(),
+ ConcreteDataType::uint8_datatype(),
+ ConcreteDataType::uint16_datatype(),
+ ConcreteDataType::uint32_datatype(),
+ ConcreteDataType::uint64_datatype(),
+ ]
+});
+
+/// Function that returns [s2] encoding cellid for a given geospatial coordinate.
+///
+/// [s2]: http://s2geometry.io
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct S2LatLngToCell;
+
+impl Function for S2LatLngToCell {
+ fn name(&self) -> &str {
+ "s2_latlng_to_cell"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ let mut signatures = Vec::with_capacity(COORDINATE_TYPES.len());
+ for coord_type in COORDINATE_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![
+ // latitude
+ coord_type.clone(),
+ // longitude
+ coord_type.clone(),
+ ]));
+ }
+ Signature::one_of(signatures, Volatility::Stable)
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let lat_vec = &columns[0];
+ let lon_vec = &columns[1];
+
+ let size = lat_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let lat = lat_vec.get(i).as_f64_lossy();
+ let lon = lon_vec.get(i).as_f64_lossy();
+
+ let result = match (lat, lon) {
+ (Some(lat), Some(lon)) => {
+ let coord = LatLng::from_degrees(lat, lon);
+ ensure!(
+ coord.is_valid(),
+ InvalidFuncArgsSnafu {
+ err_msg: "The input coordinates are invalid",
+ }
+ );
+ let cellid = CellID::from(coord);
+ let encoded: u64 = cellid.0;
+ Some(encoded)
+ }
+ _ => None,
+ };
+
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Return the level of current s2 cell
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct S2CellLevel;
+
+impl Function for S2CellLevel {
+ fn name(&self) -> &str {
+ "s2_cell_level"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 1);
+
+ let cell_vec = &columns[0];
+ let size = cell_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i));
+ let res = cell.map(|cell| cell.level());
+
+ results.push(res);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Return the string presentation of the cell
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct S2CellToToken;
+
+impl Function for S2CellToToken {
+ fn name(&self) -> &str {
+ "s2_cell_to_token"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::string_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 1);
+
+ let cell_vec = &columns[0];
+ let size = cell_vec.len();
+ let mut results = StringVectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i));
+ let res = cell.map(|cell| cell.to_token());
+
+ results.push(res.as_deref());
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+/// Return parent at given level of current s2 cell
+#[derive(Clone, Debug, Default, Display)]
+#[display("{}", self.name())]
+pub struct S2CellParent;
+
+impl Function for S2CellParent {
+ fn name(&self) -> &str {
+ "s2_cell_parent"
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::uint64_datatype())
+ }
+
+ fn signature(&self) -> Signature {
+ signature_of_cell_and_level()
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure_columns_n!(columns, 2);
+
+ let cell_vec = &columns[0];
+ let level_vec = &columns[1];
+ let size = cell_vec.len();
+ let mut results = UInt64VectorBuilder::with_capacity(size);
+
+ for i in 0..size {
+ let cell = cell_from_value(cell_vec.get(i));
+ let level = value_to_level(level_vec.get(i))?;
+ let result = cell.map(|cell| cell.parent(level).0);
+
+ results.push(result);
+ }
+
+ Ok(results.to_vector())
+ }
+}
+
+fn signature_of_cell() -> Signature {
+ let mut signatures = Vec::with_capacity(CELL_TYPES.len());
+ for cell_type in CELL_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![cell_type.clone()]));
+ }
+
+ Signature::one_of(signatures, Volatility::Stable)
+}
+
+fn signature_of_cell_and_level() -> Signature {
+ let mut signatures = Vec::with_capacity(CELL_TYPES.len() * LEVEL_TYPES.len());
+ for cell_type in CELL_TYPES.as_slice() {
+ for level_type in LEVEL_TYPES.as_slice() {
+ signatures.push(TypeSignature::Exact(vec![
+ cell_type.clone(),
+ level_type.clone(),
+ ]));
+ }
+ }
+ Signature::one_of(signatures, Volatility::Stable)
+}
+
+fn cell_from_value(v: Value) -> Option {
+ match v {
+ Value::Int64(v) => Some(CellID(v as u64)),
+ Value::UInt64(v) => Some(CellID(v)),
+ _ => None,
+ }
+}
+
+fn value_to_level(v: Value) -> Result {
+ match v {
+ Value::Int8(v) => ensure_and_coerce!(v >= 0 && v <= MAX_LEVEL as i8, v as u64),
+ Value::Int16(v) => ensure_and_coerce!(v >= 0 && v <= MAX_LEVEL as i16, v as u64),
+ Value::Int32(v) => ensure_and_coerce!(v >= 0 && v <= MAX_LEVEL as i32, v as u64),
+ Value::Int64(v) => ensure_and_coerce!(v >= 0 && v <= MAX_LEVEL as i64, v as u64),
+ Value::UInt8(v) => ensure_and_coerce!(v <= MAX_LEVEL as u8, v as u64),
+ Value::UInt16(v) => ensure_and_coerce!(v <= MAX_LEVEL as u16, v as u64),
+ Value::UInt32(v) => ensure_and_coerce!(v <= MAX_LEVEL as u32, v as u64),
+ Value::UInt64(v) => ensure_and_coerce!(v <= MAX_LEVEL, v),
+ _ => unreachable!(),
+ }
+}
diff --git a/src/common/function/src/scalars/json.rs b/src/common/function/src/scalars/json.rs
index 3812b33f23..2c420c1661 100644
--- a/src/common/function/src/scalars/json.rs
+++ b/src/common/function/src/scalars/json.rs
@@ -13,11 +13,19 @@
// limitations under the License.
use std::sync::Arc;
+mod json_get;
+mod json_is;
+mod json_path_exists;
+mod json_path_match;
mod json_to_string;
-mod to_json;
+mod parse_json;
+use json_get::{JsonGetBool, JsonGetFloat, JsonGetInt, JsonGetString};
+use json_is::{
+ JsonIsArray, JsonIsBool, JsonIsFloat, JsonIsInt, JsonIsNull, JsonIsObject, JsonIsString,
+};
use json_to_string::JsonToStringFunction;
-use to_json::ToJsonFunction;
+use parse_json::ParseJsonFunction;
use crate::function_registry::FunctionRegistry;
@@ -26,6 +34,22 @@ pub(crate) struct JsonFunction;
impl JsonFunction {
pub fn register(registry: &FunctionRegistry) {
registry.register(Arc::new(JsonToStringFunction));
- registry.register(Arc::new(ToJsonFunction));
+ registry.register(Arc::new(ParseJsonFunction));
+
+ registry.register(Arc::new(JsonGetInt));
+ registry.register(Arc::new(JsonGetFloat));
+ registry.register(Arc::new(JsonGetString));
+ registry.register(Arc::new(JsonGetBool));
+
+ registry.register(Arc::new(JsonIsNull));
+ registry.register(Arc::new(JsonIsInt));
+ registry.register(Arc::new(JsonIsFloat));
+ registry.register(Arc::new(JsonIsString));
+ registry.register(Arc::new(JsonIsBool));
+ registry.register(Arc::new(JsonIsArray));
+ registry.register(Arc::new(JsonIsObject));
+
+ registry.register(Arc::new(json_path_exists::JsonPathExistsFunction));
+ registry.register(Arc::new(json_path_match::JsonPathMatchFunction));
}
}
diff --git a/src/common/function/src/scalars/json/json_get.rs b/src/common/function/src/scalars/json/json_get.rs
new file mode 100644
index 0000000000..d31f7a0c6e
--- /dev/null
+++ b/src/common/function/src/scalars/json/json_get.rs
@@ -0,0 +1,454 @@
+// Copyright 2023 Greptime Team
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+use std::fmt::{self, Display};
+
+use common_query::error::{InvalidFuncArgsSnafu, Result, UnsupportedInputDataTypeSnafu};
+use common_query::prelude::Signature;
+use datafusion::logical_expr::Volatility;
+use datatypes::data_type::ConcreteDataType;
+use datatypes::prelude::VectorRef;
+use datatypes::scalars::ScalarVectorBuilder;
+use datatypes::vectors::{
+ BooleanVectorBuilder, Float64VectorBuilder, Int64VectorBuilder, MutableVector,
+ StringVectorBuilder,
+};
+use snafu::ensure;
+
+use crate::function::{Function, FunctionContext};
+
+fn get_json_by_path(json: &[u8], path: &str) -> Option> {
+ let json_path = jsonb::jsonpath::parse_json_path(path.as_bytes());
+ match json_path {
+ Ok(json_path) => {
+ let mut sub_jsonb = Vec::new();
+ let mut sub_offsets = Vec::new();
+ match jsonb::get_by_path(json, json_path, &mut sub_jsonb, &mut sub_offsets) {
+ Ok(_) => Some(sub_jsonb),
+ Err(_) => None,
+ }
+ }
+ _ => None,
+ }
+}
+
+/// Get the value from the JSONB by the given path and return it as specified type.
+/// If the path does not exist or the value is not the type specified, return `NULL`.
+macro_rules! json_get {
+ // e.g. name = JsonGetInt, type = Int64, rust_type = i64, doc = "Get the value from the JSONB by the given path and return it as an integer."
+ ($name:ident, $type:ident, $rust_type:ident, $doc:expr) => {
+ paste::paste! {
+ #[doc = $doc]
+ #[derive(Clone, Debug, Default)]
+ pub struct $name;
+
+ impl Function for $name {
+ fn name(&self) -> &str {
+ stringify!([<$name:snake>])
+ }
+
+ fn return_type(&self, _input_types: &[ConcreteDataType]) -> Result {
+ Ok(ConcreteDataType::[<$type:snake _datatype>]())
+ }
+
+ fn signature(&self) -> Signature {
+ Signature::exact(
+ vec![
+ ConcreteDataType::json_datatype(),
+ ConcreteDataType::string_datatype(),
+ ],
+ Volatility::Immutable,
+ )
+ }
+
+ fn eval(&self, _func_ctx: FunctionContext, columns: &[VectorRef]) -> Result {
+ ensure!(
+ columns.len() == 2,
+ InvalidFuncArgsSnafu {
+ err_msg: format!(
+ "The length of the args is not correct, expect exactly two, have: {}",
+ columns.len()
+ ),
+ }
+ );
+ let jsons = &columns[0];
+ let paths = &columns[1];
+
+ let size = jsons.len();
+ let datatype = jsons.data_type();
+ let mut results = [<$type VectorBuilder>]::with_capacity(size);
+
+ match datatype {
+ // JSON data type uses binary vector
+ ConcreteDataType::Binary(_) => {
+ for i in 0..size {
+ let json = jsons.get_ref(i);
+ let path = paths.get_ref(i);
+
+ let json = json.as_binary();
+ let path = path.as_string();
+ let result = match (json, path) {
+ (Ok(Some(json)), Ok(Some(path))) => {
+ get_json_by_path(json, path)
+ .and_then(|json| { jsonb::[](&json).ok() })
+ }
+ _ => None,
+ };
+
+ results.push(result);
+ }
+ }
+ _ => {
+ return UnsupportedInputDataTypeSnafu {
+ function: stringify!([<$name:snake>]),
+ datatypes: columns.iter().map(|c| c.data_type()).collect::