This is an automated email from the ASF dual-hosted git repository.
jiacai2050 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-horaedb.git
The following commit(s) were added to refs/heads/main by this push:
new 9e356c62 chore: upgrade rustc version (#1489)
9e356c62 is described below
commit 9e356c62a7e3db3b27b457a6699eac1a11941db9
Author: 鲍金日 <[email protected]>
AuthorDate: Tue Mar 5 17:33:03 2024 +0800
chore: upgrade rustc version (#1489)
## Rationale
Upgrade rustc version
## Detailed Changes
- upgrade rustc version
- upgrade rand version
- upgrade obkv-client version
- upgrade clap version
- Adapt to new APIs
## Test Plan
CI
---
.github/workflows/ci.yml | 2 +-
.github/workflows/coverage.yml | 2 +-
Cargo.lock | 373 ++++++++-------------
Cargo.toml | 2 +-
rust-toolchain.toml | 2 +-
.../src/instance/reorder_memtable.rs | 3 +-
src/analytic_engine/src/lib.rs | 8 +-
src/analytic_engine/src/memtable/layered/mod.rs | 12 +-
src/analytic_engine/src/table/mod.rs | 1 +
src/benchmarks/src/bin/sst-tools.rs | 10 +-
src/common_types/src/column_block.rs | 2 +-
src/components/codec/src/columnar/mod.rs | 4 +-
src/components/object_store/src/disk_cache.rs | 2 +-
src/components/parquet_ext/src/prune/equal.rs | 2 +-
src/components/partitioned_lock/src/lib.rs | 16 +-
src/components/profile/src/lib.rs | 1 +
src/components/skiplist/Cargo.toml | 2 +-
src/components/table_kv/Cargo.toml | 2 +-
src/df_engine_extensions/src/dist_sql_query/mod.rs | 6 +-
src/horaedb/bin/horaedb-server.rs | 14 +-
src/proxy/src/handlers/mod.rs | 10 +-
src/proxy/src/hotspot.rs | 2 +-
.../physical_plan_extension/prom_align.rs | 2 +-
.../src/logical_optimizer/type_conversion.rs | 5 +-
src/query_frontend/src/planner.rs | 2 +-
src/remote_engine_client/src/client.rs | 75 +++--
src/router/src/rule_based.rs | 2 +-
.../src/partition/rule/df_adapter/extractor.rs | 4 +-
.../src/partition/rule/df_adapter/mod.rs | 4 +-
src/table_engine/src/partition/rule/key.rs | 2 +-
src/tools/src/bin/sst-metadata.rs | 4 +-
31 files changed, 244 insertions(+), 334 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e4d0f5ad..3ee690b6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -42,7 +42,7 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
LOCK_FILE: Cargo.lock
- RUST_VERSION: nightly-2023-08-28
+ RUST_VERSION: nightly-2024-01-28
jobs:
style-check:
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 9beec670..1f91451a 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -34,7 +34,7 @@ env:
RUSTFLAGS: "-C debuginfo=1"
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
- RUST_VERSION: nightly-2023-08-28
+ RUST_VERSION: nightly-2024-01-28
jobs:
coverage:
diff --git a/Cargo.lock b/Cargo.lock
index 58c628de..47acfbe4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -17,22 +17,13 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-[[package]]
-name = "ahash"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217"
-dependencies = [
- "const-random",
-]
-
[[package]]
name = "ahash"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
dependencies = [
- "getrandom 0.2.12",
+ "getrandom",
"once_cell",
"version_check",
]
@@ -45,7 +36,7 @@ checksum =
"2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
dependencies = [
"cfg-if 1.0.0",
"const-random",
- "getrandom 0.2.12",
+ "getrandom",
"once_cell",
"version_check",
]
@@ -172,12 +163,54 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "anstream"
+version = "0.6.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb"
+dependencies = [
+ "anstyle",
+ "anstyle-parse",
+ "anstyle-query",
+ "anstyle-wincon",
+ "colorchoice",
+ "utf8parse",
+]
+
[[package]]
name = "anstyle"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd"
+[[package]]
+name = "anstyle-parse"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c"
+dependencies = [
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle-query"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
+dependencies = [
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "anstyle-wincon"
+version = "3.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7"
+dependencies = [
+ "anstyle",
+ "windows-sys 0.52.0",
+]
+
[[package]]
name = "anyhow"
version = "1.0.70"
@@ -887,7 +920,7 @@ dependencies = [
"arrow 49.0.0",
"base64 0.13.1",
"bytes_ext",
- "clap 3.2.23",
+ "clap",
"common_types",
"criterion",
"env_logger",
@@ -1372,67 +1405,43 @@ dependencies = [
[[package]]
name = "clap"
-version = "3.2.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5"
-dependencies = [
- "atty",
- "bitflags 1.3.2",
- "clap_derive",
- "clap_lex 0.2.4",
- "indexmap 1.9.3",
- "once_cell",
- "strsim",
- "termcolor",
- "textwrap",
-]
-
-[[package]]
-name = "clap"
-version = "4.3.19"
+version = "4.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d"
+checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da"
dependencies = [
"clap_builder",
+ "clap_derive",
]
[[package]]
name = "clap_builder"
-version = "4.3.19"
+version = "4.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1"
+checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb"
dependencies = [
+ "anstream",
"anstyle",
- "clap_lex 0.5.0",
+ "clap_lex",
+ "strsim 0.11.0",
]
[[package]]
name = "clap_derive"
-version = "3.2.18"
+version = "4.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"
+checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47"
dependencies = [
"heck",
- "proc-macro-error",
"proc-macro2",
"quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "clap_lex"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
-dependencies = [
- "os_str_bytes",
+ "syn 2.0.48",
]
[[package]]
name = "clap_lex"
-version = "0.5.0"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
+checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce"
[[package]]
name = "clru"
@@ -1496,6 +1505,12 @@ dependencies = [
"unicode-width",
]
+[[package]]
+name = "colorchoice"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
+
[[package]]
name = "comfy-table"
version = "6.1.4"
@@ -1547,7 +1562,7 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e"
dependencies = [
- "crossbeam-utils 0.8.15",
+ "crossbeam-utils",
]
[[package]]
@@ -1582,7 +1597,7 @@ checksum =
"57ab2224a0311582eb03adba4caaf18644f7b1f10a760803a803b9b605187fc7"
dependencies = [
"console-api",
"crossbeam-channel",
- "crossbeam-utils 0.8.15",
+ "crossbeam-utils",
"futures 0.3.28",
"hdrhistogram",
"humantime 2.1.0",
@@ -1620,7 +1635,7 @@ version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb"
dependencies = [
- "getrandom 0.2.12",
+ "getrandom",
"once_cell",
"proc-macro-hack",
"tiny-keccak",
@@ -1698,7 +1713,7 @@ dependencies = [
"anes",
"cast",
"ciborium",
- "clap 4.3.19",
+ "clap",
"criterion-plot",
"is-terminal",
"itertools 0.10.5",
@@ -1733,10 +1748,10 @@ checksum =
"2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-channel",
- "crossbeam-deque 0.8.3",
- "crossbeam-epoch 0.9.14",
+ "crossbeam-deque",
+ "crossbeam-epoch",
"crossbeam-queue",
- "crossbeam-utils 0.8.15",
+ "crossbeam-utils",
]
[[package]]
@@ -1746,18 +1761,7 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c"
dependencies = [
"cfg-if 1.0.0",
- "crossbeam-utils 0.8.15",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed"
-dependencies = [
- "crossbeam-epoch 0.8.2",
- "crossbeam-utils 0.7.2",
- "maybe-uninit",
+ "crossbeam-utils",
]
[[package]]
@@ -1767,23 +1771,8 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
dependencies = [
"cfg-if 1.0.0",
- "crossbeam-epoch 0.9.14",
- "crossbeam-utils 0.8.15",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
-dependencies = [
- "autocfg",
- "cfg-if 0.1.10",
- "crossbeam-utils 0.7.2",
- "lazy_static",
- "maybe-uninit",
- "memoffset 0.5.6",
- "scopeguard",
+ "crossbeam-epoch",
+ "crossbeam-utils",
]
[[package]]
@@ -1794,7 +1783,7 @@ checksum =
"46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695"
dependencies = [
"autocfg",
"cfg-if 1.0.0",
- "crossbeam-utils 0.8.15",
+ "crossbeam-utils",
"memoffset 0.8.0",
"scopeguard",
]
@@ -1806,18 +1795,19 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add"
dependencies = [
"cfg-if 1.0.0",
- "crossbeam-utils 0.8.15",
+ "crossbeam-utils",
]
[[package]]
-name = "crossbeam-utils"
-version = "0.7.2"
+name = "crossbeam-skiplist"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
+checksum = "883a5821d7d079fcf34ac55f27a833ee61678110f6b97637cc74513c0d0b42fc"
dependencies = [
- "autocfg",
- "cfg-if 0.1.10",
- "lazy_static",
+ "cfg-if 1.0.0",
+ "crossbeam-epoch",
+ "crossbeam-utils",
+ "scopeguard",
]
[[package]]
@@ -1940,7 +1930,7 @@ dependencies = [
"ident_case",
"proc-macro2",
"quote",
- "strsim",
+ "strsim 0.10.0",
"syn 1.0.109",
]
@@ -1954,7 +1944,7 @@ dependencies = [
"ident_case",
"proc-macro2",
"quote",
- "strsim",
+ "strsim 0.10.0",
"syn 2.0.48",
]
@@ -1980,17 +1970,6 @@ dependencies = [
"syn 2.0.48",
]
-[[package]]
-name = "dashmap"
-version = "3.11.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f260e2fc850179ef410018660006951c1b55b79e8087e87111a2c388994b9b5"
-dependencies = [
- "ahash 0.3.8",
- "cfg-if 0.1.10",
- "num_cpus",
-]
-
[[package]]
name = "dashmap"
version = "5.4.0"
@@ -2018,7 +1997,7 @@ dependencies = [
"bytes",
"bzip2",
"chrono",
- "dashmap 5.4.0",
+ "dashmap",
"datafusion-common",
"datafusion-execution",
"datafusion-expr",
@@ -2076,7 +2055,7 @@ source =
"git+https://github.com/CeresDB/arrow-datafusion.git?rev=e21b03154#e21b
dependencies = [
"arrow 49.0.0",
"chrono",
- "dashmap 5.4.0",
+ "dashmap",
"datafusion-common",
"datafusion-expr",
"futures 0.3.28",
@@ -2514,13 +2493,13 @@ checksum =
"0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]]
name = "fail"
-version = "0.4.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3be3c61c59fdc91f5dbc3ea31ee8623122ce80057058be560654c5d410d181a6"
+checksum = "fe5e43d0f78a42ad591453aedb1d7ae631ce7ee445c7643691055a9ed8d3b01c"
dependencies = [
- "lazy_static",
"log",
- "rand 0.7.3",
+ "once_cell",
+ "rand 0.8.5",
]
[[package]]
@@ -2861,17 +2840,6 @@ dependencies = [
name = "generic_error"
version = "2.0.0"
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if 1.0.0",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
-]
-
[[package]]
name = "getrandom"
version = "0.2.12"
@@ -3058,7 +3026,7 @@ dependencies = [
"analytic_engine",
"catalog",
"catalog_impls",
- "clap 3.2.23",
+ "clap",
"cluster",
"datafusion",
"df_operator",
@@ -3092,7 +3060,7 @@ checksum =
"7bb850f1e1fc5d95b31278a842836652f0159e7f00d5e846e78c6076ae46b3b3"
dependencies = [
"arrow 38.0.0",
"async-trait",
- "dashmap 5.4.0",
+ "dashmap",
"futures 0.3.28",
"horaedbproto 1.0.24",
"paste 1.0.12",
@@ -3899,12 +3867,6 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40"
-[[package]]
-name = "maybe-uninit"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
-
[[package]]
name = "md-5"
version = "0.10.5"
@@ -3935,15 +3897,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "memoffset"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa"
-dependencies = [
- "autocfg",
-]
-
[[package]]
name = "memoffset"
version = "0.6.5"
@@ -4006,7 +3959,7 @@ dependencies = [
name = "metric_ext"
version = "2.0.0"
dependencies = [
- "crossbeam-utils 0.8.15",
+ "crossbeam-utils",
"serde",
"serde_json",
"time_ext",
@@ -4064,8 +4017,8 @@ dependencies = [
"async-io",
"async-lock",
"crossbeam-channel",
- "crossbeam-epoch 0.9.14",
- "crossbeam-utils 0.8.15",
+ "crossbeam-epoch",
+ "crossbeam-utils",
"futures-util",
"num_cpus",
"once_cell",
@@ -4552,7 +4505,7 @@ dependencies = [
[[package]]
name = "obkv-table-client-rs"
version = "0.1.0"
-source =
"git+https://github.com/oceanbase/obkv-table-client-rs.git?rev=eb958b29df93cac5f3a08f51dd9a962540cb67f9#eb958b29df93cac5f3a08f51dd9a962540cb67f9"
+source =
"git+https://github.com/oceanbase/obkv-table-client-rs.git?rev=81cee5d55a2423686dee07163f1ec60f9e28272c#81cee5d55a2423686dee07163f1ec60f9e28272c"
dependencies = [
"anyhow",
"byteorder",
@@ -4631,12 +4584,6 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "os_str_bytes"
-version = "6.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267"
-
[[package]]
name = "overload"
version = "0.1.1"
@@ -5224,30 +5171,30 @@ dependencies = [
[[package]]
name = "prometheus"
-version = "0.10.0"
+version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30d70cf4412832bcac9cffe27906f4a66e450d323525e977168c70d1b36120ae"
+checksum = "5986aa8d62380092d2f50f8b1cdba9cb9b6731ffd4b25b51fd126b6c3e05b99c"
dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if 1.0.0",
"fnv",
"lazy_static",
+ "memchr",
"parking_lot 0.11.2",
- "regex",
+ "protobuf",
"thiserror",
]
[[package]]
name = "prometheus"
-version = "0.12.0"
+version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5986aa8d62380092d2f50f8b1cdba9cb9b6731ffd4b25b51fd126b6c3e05b99c"
+checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c"
dependencies = [
"cfg-if 1.0.0",
"fnv",
"lazy_static",
"memchr",
- "parking_lot 0.11.2",
- "protobuf",
+ "parking_lot 0.12.1",
"thiserror",
]
@@ -5509,7 +5456,7 @@ version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e31331286705f455e56cca62e0e717158474ff02b7936c1fa596d983f4ae27"
dependencies = [
- "crossbeam-utils 0.8.15",
+ "crossbeam-utils",
"libc",
"mach",
"once_cell",
@@ -5677,19 +5624,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "rand"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
-dependencies = [
- "getrandom 0.1.16",
- "libc",
- "rand_chacha 0.2.2",
- "rand_core 0.5.1",
- "rand_hc",
-]
-
[[package]]
name = "rand"
version = "0.8.5"
@@ -5697,20 +5631,10 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
- "rand_chacha 0.3.1",
+ "rand_chacha",
"rand_core 0.6.4",
]
-[[package]]
-name = "rand_chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.5.1",
-]
-
[[package]]
name = "rand_chacha"
version = "0.3.1"
@@ -5736,31 +5660,13 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
-]
-
[[package]]
name = "rand_core"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
- "getrandom 0.2.12",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.1",
+ "getrandom",
]
[[package]]
@@ -5788,8 +5694,8 @@ version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed"
dependencies = [
- "crossbeam-deque 0.8.3",
- "crossbeam-utils 0.8.15",
+ "crossbeam-deque",
+ "crossbeam-utils",
]
[[package]]
@@ -5825,7 +5731,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [
- "getrandom 0.2.12",
+ "getrandom",
"redox_syscall 0.2.16",
"thiserror",
]
@@ -5971,7 +5877,7 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74"
dependencies = [
"cc",
- "getrandom 0.2.12",
+ "getrandom",
"libc",
"spin 0.9.8",
"untrusted 0.9.0",
@@ -6121,9 +6027,9 @@ checksum =
"08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc-serialize"
-version = "0.3.24"
+version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
+checksum = "fe834bc780604f4674073badbad26d7219cadfb4a2275802db12cbae17498401"
[[package]]
name = "rustc_version"
@@ -6837,6 +6743,12 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
+[[package]]
+name = "strsim"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01"
+
[[package]]
name = "strum"
version = "0.24.1"
@@ -7110,12 +7022,6 @@ dependencies = [
"env_logger",
]
-[[package]]
-name = "textwrap"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
-
[[package]]
name = "thiserror"
version = "1.0.56"
@@ -7502,7 +7408,7 @@ version = "2.0.0"
dependencies = [
"analytic_engine",
"anyhow",
- "clap 3.2.23",
+ "clap",
"common_types",
"futures 0.3.28",
"generic_error",
@@ -7795,13 +7701,19 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
+[[package]]
+name = "utf8parse"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
+
[[package]]
name = "uuid"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560"
dependencies = [
- "getrandom 0.2.12",
+ "getrandom",
"rand 0.8.5",
"uuid-macro-internal",
]
@@ -7938,12 +7850,6 @@ dependencies = [
"tracing",
]
-[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
[[package]]
name = "wasi"
version = "0.10.2+wasi-snapshot-preview1"
@@ -8161,6 +8067,15 @@ dependencies = [
"windows-targets 0.48.1",
]
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets 0.52.0",
+]
+
[[package]]
name = "windows-targets"
version = "0.42.2"
@@ -8461,16 +8376,18 @@ dependencies = [
[[package]]
name = "yatp"
version = "0.0.1"
-source =
"git+https://github.com/tikv/yatp.git?rev=4b71f8abd86890f0d1e95778c2b6bf5a9ee4c502#4b71f8abd86890f0d1e95778c2b6bf5a9ee4c502"
+source =
"git+https://github.com/tikv/yatp.git?rev=793be4d789d4bd15292fe4d06e38063b4ec9d48e#793be4d789d4bd15292fe4d06e38063b4ec9d48e"
dependencies = [
- "crossbeam-deque 0.7.4",
- "dashmap 3.11.10",
+ "crossbeam-deque",
+ "crossbeam-skiplist",
+ "crossbeam-utils",
+ "dashmap",
"fail",
"lazy_static",
"num_cpus",
- "parking_lot_core 0.8.6",
- "prometheus 0.10.0",
- "rand 0.7.3",
+ "parking_lot_core 0.9.7",
+ "prometheus 0.13.3",
+ "rand 0.8.5",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 29174119..deb63e11 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -101,7 +101,7 @@ catalog_impls = { path = "src/catalog_impls" }
horaedbproto = { git =
"https://github.com/apache/incubator-horaedb-proto.git", rev =
"19ece8f771fc0b3e8e734072cc3d8040de6c74cb" }
codec = { path = "src/components/codec" }
chrono = "0.4"
-clap = "3.0"
+clap = "4.5.1"
clru = "0.6.1"
cluster = { path = "src/cluster" }
criterion = "0.5"
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index a215ce60..10480e03 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -16,5 +16,5 @@
# under the License.
[toolchain]
-channel = "nightly-2023-08-28"
+channel = "nightly-2024-01-28"
components = [ "rustfmt", "clippy" ]
diff --git a/src/analytic_engine/src/instance/reorder_memtable.rs
b/src/analytic_engine/src/instance/reorder_memtable.rs
index c37417bf..d65bb92e 100644
--- a/src/analytic_engine/src/instance/reorder_memtable.rs
+++ b/src/analytic_engine/src/instance/reorder_memtable.rs
@@ -24,8 +24,7 @@ use std::{
};
pub use arrow::{
- datatypes::{DataType, Field, Schema as ArrowSchema, SchemaRef as
ArrowSchemaRef},
- record_batch::RecordBatch as ArrowRecordBatch,
+ datatypes::SchemaRef as ArrowSchemaRef, record_batch::RecordBatch as
ArrowRecordBatch,
};
use async_trait::async_trait;
use common_types::{
diff --git a/src/analytic_engine/src/lib.rs b/src/analytic_engine/src/lib.rs
index e064f1fc..e363e782 100644
--- a/src/analytic_engine/src/lib.rs
+++ b/src/analytic_engine/src/lib.rs
@@ -186,11 +186,11 @@ impl Default for Config {
sst_data_cache_cap: Some(1000),
manifest: ManifestOptions::default(),
max_rows_in_write_queue: 0,
- /// Zero means disabling this param, give a positive value to
enable
- /// it.
+ // Zero means disabling this param, give a positive value to enable
+ // it.
space_write_buffer_size: 0,
- /// Zero means disabling this param, give a positive value to
enable
- /// it.
+ // Zero means disabling this param, give a positive value to enable
+ // it.
db_write_buffer_size: 0,
preflush_write_buffer_size_ratio: 0.75,
enable_primary_key_sampling: false,
diff --git a/src/analytic_engine/src/memtable/layered/mod.rs
b/src/analytic_engine/src/memtable/layered/mod.rs
index 0f4b697c..35d0b4a1 100644
--- a/src/analytic_engine/src/memtable/layered/mod.rs
+++ b/src/analytic_engine/src/memtable/layered/mod.rs
@@ -642,22 +642,18 @@ mod tests {
// Min key
let key_encoder = ComparableInternalKey::new(data[0].0, schema);
- let mut min_key = Vec::new();
- min_key.reserve(key_encoder.estimate_encoded_size(&data[0].1));
+ let mut min_key =
Vec::with_capacity(key_encoder.estimate_encoded_size(&data[0].1));
key_encoder.encode(&mut min_key, &data[0].1).unwrap();
let key_encoder = ComparableInternalKey::new(data[0].0, schema);
- let mut min_key = Vec::new();
- min_key.reserve(key_encoder.estimate_encoded_size(&data[0].1));
+ let mut min_key =
Vec::with_capacity(key_encoder.estimate_encoded_size(&data[0].1));
key_encoder.encode(&mut min_key, &data[0].1).unwrap();
// Max key
let key_encoder = ComparableInternalKey::new(data[6].0, schema);
- let mut max_key = Vec::new();
- max_key.reserve(key_encoder.estimate_encoded_size(&data[6].1));
+ let mut max_key =
Vec::with_capacity(key_encoder.estimate_encoded_size(&data[6].1));
key_encoder.encode(&mut max_key, &data[6].1).unwrap();
let key_encoder = ComparableInternalKey::new(data[6].0, schema);
- let mut max_key = Vec::new();
- max_key.reserve(key_encoder.estimate_encoded_size(&data[6].1));
+ let mut max_key =
Vec::with_capacity(key_encoder.estimate_encoded_size(&data[6].1));
key_encoder.encode(&mut max_key, &data[6].1).unwrap();
assert_eq!(min_key, memtable.min_key().unwrap().to_vec());
diff --git a/src/analytic_engine/src/table/mod.rs
b/src/analytic_engine/src/table/mod.rs
index 674f6b3b..7bd73553 100644
--- a/src/analytic_engine/src/table/mod.rs
+++ b/src/analytic_engine/src/table/mod.rs
@@ -200,6 +200,7 @@ impl PendingWrites {
enum QueueResult {
/// This request is rejected because the queue is full or the schema is
/// different.
+ #[allow(dead_code)]
Reject(WriteRequest),
/// This request is the first one in the queue.
First,
diff --git a/src/benchmarks/src/bin/sst-tools.rs
b/src/benchmarks/src/bin/sst-tools.rs
index 5f894b94..3256acd9 100644
--- a/src/benchmarks/src/bin/sst-tools.rs
+++ b/src/benchmarks/src/bin/sst-tools.rs
@@ -21,7 +21,7 @@ use benchmarks::{
sst_tools::{self, MergeSstConfig, RebuildSstConfig},
util,
};
-use clap::{App, Arg};
+use clap::{Arg, Command};
use logger::info;
use serde::Deserialize;
@@ -51,19 +51,19 @@ fn config_from_path(path: &str) -> Config {
fn main() {
env_logger::init();
- let matches = App::new("SST Tools")
+ let matches = Command::new("SST Tools")
.arg(
- Arg::with_name("config")
+ Arg::new("config")
.short('c')
.long("config")
.required(true)
- .takes_value(true)
+ .num_args(1)
.help("Set configuration file, eg: \"/path/server.toml\""),
)
.get_matches();
let config_path = matches
- .value_of("config")
+ .get_one::<String>("config")
.expect("Config file is required.");
let config = config_from_path(config_path);
diff --git a/src/common_types/src/column_block.rs
b/src/common_types/src/column_block.rs
index 7f4c480e..d200e51b 100644
--- a/src/common_types/src/column_block.rs
+++ b/src/common_types/src/column_block.rs
@@ -1266,7 +1266,7 @@ mod tests {
#[test]
fn test_column_block_string_dictionary_builder() {
let schema = build_schema_with_dictionary();
- let rows = vec![
+ let rows = [
build_row_for_dictionary(
b"a",
1,
diff --git a/src/components/codec/src/columnar/mod.rs
b/src/components/codec/src/columnar/mod.rs
index 4485e53a..bc20c217 100644
--- a/src/components/codec/src/columnar/mod.rs
+++ b/src/components/codec/src/columnar/mod.rs
@@ -751,7 +751,7 @@ mod tests {
#[test]
fn test_overflow_timestamp() {
- let datums = vec![
+ let datums = [
Datum::from(Timestamp::new(i64::MIN)),
Datum::from(Timestamp::new(10)),
Datum::from(Timestamp::new(1024)),
@@ -823,7 +823,7 @@ mod tests {
#[test]
fn test_large_string() {
- let large_string_bytes = vec![
+ let large_string_bytes = [
vec![b'a'; 500],
vec![b'x'; 5000],
vec![b'x'; 5],
diff --git a/src/components/object_store/src/disk_cache.rs
b/src/components/object_store/src/disk_cache.rs
index cc6bd8a0..981e6d06 100644
--- a/src/components/object_store/src/disk_cache.rs
+++ b/src/components/object_store/src/disk_cache.rs
@@ -1166,7 +1166,7 @@ mod test {
}
store.inner.put(&location, buf.freeze()).await.unwrap();
- let testcases = vec![
+ let testcases = [
(0..6, "a b c "),
(0..16, "a b c d e f g h "),
(0..17, "a b c d e f g h i"),
diff --git a/src/components/parquet_ext/src/prune/equal.rs
b/src/components/parquet_ext/src/prune/equal.rs
index f42fcc80..c66436d5 100644
--- a/src/components/parquet_ext/src/prune/equal.rs
+++ b/src/components/parquet_ext/src/prune/equal.rs
@@ -457,7 +457,7 @@ mod tests {
// | 0 | 1 | 2 |
// | 1 | 2 | 3 |
// | 2 | 3 | 4 |
- let row_groups = vec![vec![0, 1, 2], vec![1, 2, 3], vec![2, 3, 4]];
+ let row_groups = [vec![0, 1, 2], vec![1, 2, 3], vec![2, 3, 4]];
let is_equal = |pos: ColumnPosition, val: &ScalarValue, negated: bool|
-> Option<bool> {
let expect_val = row_groups[pos.row_group_idx][pos.column_idx];
let val = if let ScalarValue::Int32(v) = val {
diff --git a/src/components/partitioned_lock/src/lib.rs
b/src/components/partitioned_lock/src/lib.rs
index adcb066b..de7ba345 100644
--- a/src/components/partitioned_lock/src/lib.rs
+++ b/src/components/partitioned_lock/src/lib.rs
@@ -18,7 +18,7 @@
//! Partitioned locks
use std::{
- hash::{BuildHasher, Hash, Hasher},
+ hash::{BuildHasher, Hash},
sync::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard},
};
@@ -65,11 +65,7 @@ where
}
fn get_partition<K: Eq + Hash>(&self, key: &K) -> &RwLock<T> {
- let mut hasher = self.hash_builder.build_hasher();
-
- key.hash(&mut hasher);
-
- &self.partitions[(hasher.finish() as usize) & self.partition_mask]
+ &self.partitions[(self.hash_builder.hash_one(key) as usize) &
self.partition_mask]
}
#[cfg(test)]
@@ -116,9 +112,7 @@ where
}
fn get_partition<K: Eq + Hash>(&self, key: &K) -> &Mutex<T> {
- let mut hasher = self.hash_builder.build_hasher();
- key.hash(&mut hasher);
- &self.partitions[(hasher.finish() as usize) & self.partition_mask]
+ &self.partitions[(self.hash_builder.hash_one(key) as usize) &
self.partition_mask]
}
#[cfg(test)]
@@ -169,9 +163,7 @@ where
}
fn get_partition<K: Eq + Hash>(&self, key: &K) -> &tokio::sync::Mutex<T> {
- let mut hasher = self.hash_builder.build_hasher();
- key.hash(&mut hasher);
- &self.partitions[(hasher.finish() as usize) & self.partition_mask]
+ &self.partitions[(self.hash_builder.hash_one(key) as usize) &
self.partition_mask]
}
#[cfg(test)]
diff --git a/src/components/profile/src/lib.rs
b/src/components/profile/src/lib.rs
index 82f8551a..a6e7edf7 100644
--- a/src/components/profile/src/lib.rs
+++ b/src/components/profile/src/lib.rs
@@ -67,6 +67,7 @@ fn dump_profile() -> Result<()> {
.map_err(Error::Jemalloc)
}
+#[allow(dead_code)]
struct ProfLockGuard<'a>(MutexGuard<'a, ()>);
/// ProfLockGuard hold the profile lock and take responsibilities for
diff --git a/src/components/skiplist/Cargo.toml
b/src/components/skiplist/Cargo.toml
index 84b0a5ce..78e3430c 100644
--- a/src/components/skiplist/Cargo.toml
+++ b/src/components/skiplist/Cargo.toml
@@ -35,7 +35,7 @@ rand = { workspace = true }
[dev-dependencies]
criterion = { workspace = true }
-yatp = { git = "https://github.com/tikv/yatp.git", rev =
"4b71f8abd86890f0d1e95778c2b6bf5a9ee4c502" }
+yatp = { git = "https://github.com/tikv/yatp.git", rev =
"793be4d789d4bd15292fe4d06e38063b4ec9d48e" }
[[bench]]
name = "bench"
diff --git a/src/components/table_kv/Cargo.toml
b/src/components/table_kv/Cargo.toml
index 08bdc09b..6f503ad4 100644
--- a/src/components/table_kv/Cargo.toml
+++ b/src/components/table_kv/Cargo.toml
@@ -34,7 +34,7 @@ workspace = true
lazy_static = { workspace = true }
logger = { workspace = true }
macros = { workspace = true }
-obkv-table-client-rs = { git =
"https://github.com/oceanbase/obkv-table-client-rs.git", rev =
"eb958b29df93cac5f3a08f51dd9a962540cb67f9" }
+obkv-table-client-rs = { git =
"https://github.com/oceanbase/obkv-table-client-rs.git", rev =
"81cee5d55a2423686dee07163f1ec60f9e28272c" }
prometheus = { workspace = true }
serde = { workspace = true }
snafu = { workspace = true }
diff --git a/src/df_engine_extensions/src/dist_sql_query/mod.rs
b/src/df_engine_extensions/src/dist_sql_query/mod.rs
index 8971dfb6..f41d8792 100644
--- a/src/df_engine_extensions/src/dist_sql_query/mod.rs
+++ b/src/df_engine_extensions/src/dist_sql_query/mod.rs
@@ -122,11 +122,7 @@ impl TryFrom<TableScanContext> for
horaedbproto::remote_engine::TableScanContext
type Error = datafusion::error::DataFusionError;
fn try_from(value: TableScanContext) -> DfResult<Self> {
- let pb_projected_schema = value
- .projected_schema
- .try_into()
- .box_err()
- .map_err(DataFusionError::External)?;
+ let pb_projected_schema = value.projected_schema.into();
let pb_predicate = value
.predicate
diff --git a/src/horaedb/bin/horaedb-server.rs
b/src/horaedb/bin/horaedb-server.rs
index 5e80f17b..bf666208 100644
--- a/src/horaedb/bin/horaedb-server.rs
+++ b/src/horaedb/bin/horaedb-server.rs
@@ -19,7 +19,7 @@
use std::env;
-use clap::{App, Arg};
+use clap::{Arg, Command};
use horaedb::{
config::{ClusterDeployment, Config},
setup,
@@ -65,20 +65,20 @@ fn fetch_version() -> String {
}
fn main() {
- let version = fetch_version();
- let matches = App::new("HoraeDB Server")
- .version(version.as_str())
+ let version: &'static str = Box::leak(fetch_version().into_boxed_str());
+ let matches = Command::new("HoraeDB Server")
+ .version(version)
.arg(
- Arg::with_name("config")
+ Arg::new("config")
.short('c')
.long("config")
.required(false)
- .takes_value(true)
+ .num_args(1)
.help("Set configuration file, eg: \"/path/server.toml\""),
)
.get_matches();
- let mut config = match matches.value_of("config") {
+ let mut config = match matches.get_one::<String>("config") {
Some(path) => {
let mut toml_buf = String::new();
toml_ext::parse_toml_from_path(path, &mut toml_buf).expect("Failed
to parse config.")
diff --git a/src/proxy/src/handlers/mod.rs b/src/proxy/src/handlers/mod.rs
index 6cd3ed03..1b96784e 100644
--- a/src/proxy/src/handlers/mod.rs
+++ b/src/proxy/src/handlers/mod.rs
@@ -21,15 +21,7 @@ pub mod admin;
mod error;
mod prelude {
- pub use catalog::manager::Manager as CatalogManager;
- pub use query_engine::executor::Executor as QueryExecutor;
pub use serde::{Deserialize, Serialize};
- pub use snafu::ResultExt;
- pub use warp::Filter;
- pub use crate::{
- context::RequestContext,
- handlers::error::{Error, Result},
- instance::InstanceRef,
- };
+ pub use crate::{context::RequestContext, handlers::error::Result,
instance::InstanceRef};
}
diff --git a/src/proxy/src/hotspot.rs b/src/proxy/src/hotspot.rs
index b22469ed..34d6e97f 100644
--- a/src/proxy/src/hotspot.rs
+++ b/src/proxy/src/hotspot.rs
@@ -374,7 +374,7 @@ mod test {
let vec = recorder.stat.pop_read_hots().unwrap();
assert_eq!(1, vec.len());
- assert_eq!("public/table1", vec.get(0).unwrap().0);
+ assert_eq!("public/table1", vec.first().unwrap().0);
})
}
diff --git
a/src/query_engine/src/datafusion_impl/physical_plan_extension/prom_align.rs
b/src/query_engine/src/datafusion_impl/physical_plan_extension/prom_align.rs
index 3b1a0cd9..8879b865 100644
--- a/src/query_engine/src/datafusion_impl/physical_plan_extension/prom_align.rs
+++ b/src/query_engine/src/datafusion_impl/physical_plan_extension/prom_align.rs
@@ -652,7 +652,7 @@ impl Stepper for FixedStepper {
}
// [mint, self.timestamp] has no data, skip to next step.
let skip = {
- if let Some(first_entry) = self.entries.get(0) {
+ if let Some(first_entry) = self.entries.front() {
first_entry.timestamp > self.timestamp
} else {
true
diff --git a/src/query_frontend/src/logical_optimizer/type_conversion.rs
b/src/query_frontend/src/logical_optimizer/type_conversion.rs
index 0aeaaba2..ab7ac4e6 100644
--- a/src/query_frontend/src/logical_optimizer/type_conversion.rs
+++ b/src/query_frontend/src/logical_optimizer/type_conversion.rs
@@ -319,10 +319,9 @@ fn string_to_timestamp_ms_workaround(string: &str) ->
Result<ScalarValue> {
return Ok(ScalarValue::TimestampMillisecond(Some(mills), None));
}
- Err(ArrowError::CastError(format!(
+ Err(DataFusionError::from(ArrowError::CastError(format!(
"Error parsing '{string}' as timestamp: local time representation is
invalid"
- )))
- .map_err(DataFusionError::from)
+ ))))
}
/// Converts the naive datetime (which has no specific timezone) to a
diff --git a/src/query_frontend/src/planner.rs
b/src/query_frontend/src/planner.rs
index 8e02f5ee..9fc7ade9 100644
--- a/src/query_frontend/src/planner.rs
+++ b/src/query_frontend/src/planner.rs
@@ -1369,7 +1369,7 @@ fn ensure_column_default_value_valid<P: MetaProvider>(
}
// Add evaluated column to schema
- let new_arrow_field = ArrowField::try_from(column_def).unwrap();
+ let new_arrow_field = ArrowField::from(column_def);
let to_merged_df_schema = &DFSchema::new_with_metadata(
vec![DFField::from(new_arrow_field.clone())],
HashMap::new(),
diff --git a/src/remote_engine_client/src/client.rs
b/src/remote_engine_client/src/client.rs
index f2fdd458..a96246c7 100644
--- a/src/remote_engine_client/src/client.rs
+++ b/src/remote_engine_client/src/client.rs
@@ -155,13 +155,16 @@ impl Client {
let result = result.and_then(|response| {
let response = response.into_inner();
- if let Some(header) = &response.header &&
!status_code::is_ok(header.code) {
+ if let Some(header) = &response.header
+ && !status_code::is_ok(header.code)
+ {
Server {
endpoint,
table_idents: vec![table_ident.clone()],
code: header.code,
msg: header.error.clone(),
- }.fail()
+ }
+ .fail()
} else {
Ok(response.affected_rows as usize)
}
@@ -236,13 +239,17 @@ impl Client {
let result = batch_result.and_then(|result| {
let (response, endpoint) = result;
let response = response.into_inner();
- if let Some(header) = &response.header &&
!status_code::is_ok(header.code) {
+ if let Some(header) = &response.header
+ && !status_code::is_ok(header.code)
+ {
Server {
endpoint,
table_idents: table_idents.clone(),
code: header.code,
msg: header.error.clone(),
- }.fail().box_err()
+ }
+ .fail()
+ .box_err()
} else {
Ok(response.affected_rows)
}
@@ -286,13 +293,16 @@ impl Client {
let resp = resp.and_then(|response| {
let response = response.into_inner();
- if let Some(header) = &response.header &&
!status_code::is_ok(header.code) {
+ if let Some(header) = &response.header
+ && !status_code::is_ok(header.code)
+ {
Server {
- endpoint:endpoint.clone(),
+ endpoint: endpoint.clone(),
table_idents: vec![table_ident.clone()],
code: header.code,
msg: header.error.clone(),
- }.fail()
+ }
+ .fail()
} else {
Ok(())
}
@@ -345,13 +355,16 @@ impl Client {
let resp = resp.and_then(|response| {
let response = response.into_inner();
- if let Some(header) = &response.header &&
!status_code::is_ok(header.code) {
+ if let Some(header) = &response.header
+ && !status_code::is_ok(header.code)
+ {
Server {
- endpoint:endpoint.clone(),
+ endpoint: endpoint.clone(),
table_idents: vec![table_ident.clone()],
code: header.code,
msg: header.error.clone(),
- }.fail()
+ }
+ .fail()
} else {
Ok(())
}
@@ -402,13 +415,16 @@ impl Client {
let result = result.and_then(|response| {
let response = response.into_inner();
- if let Some(header) = &response.header &&
!status_code::is_ok(header.code) {
- Server {
- endpoint:endpoint.clone(),
- table_idents: vec![table_ident.clone()],
- code: header.code,
- msg: header.error.clone(),
- }.fail()
+ if let Some(header) = &response.header
+ && !status_code::is_ok(header.code)
+ {
+ Server {
+ endpoint: endpoint.clone(),
+ table_idents: vec![table_ident.clone()],
+ code: header.code,
+ msg: header.error.clone(),
+ }
+ .fail()
} else {
Ok(response)
}
@@ -477,11 +493,7 @@ impl Client {
let plan_schema = request.plan_schema;
let mut rpc_client =
RemoteEngineServiceClient::<Channel>::new(route_context.channel);
let request_pb =
-
horaedbproto::remote_engine::ExecutePlanRequest::try_from(request.remote_request)
- .box_err()
- .context(Convert {
- msg: "Failed to convert RemoteExecuteRequest to pb",
- })?;
+
horaedbproto::remote_engine::ExecutePlanRequest::from(request.remote_request);
let result = rpc_client
.execute_physical_plan(Request::new(request_pb))
@@ -559,13 +571,18 @@ impl Stream for ClientReadRecordBatchStream {
match this.response_stream.poll_next_unpin(cx) {
Poll::Ready(Some(Ok(response))) => {
// Check header.
- if let Some(header) = response.header &&
!status_code::is_ok(header.code) {
- return Poll::Ready(Some(Server {
- endpoint: this.endpoint.clone(),
- table_idents: vec![this.table_ident.clone()],
- code: header.code,
- msg: header.error,
- }.fail()));
+ if let Some(header) = response.header
+ && !status_code::is_ok(header.code)
+ {
+ return Poll::Ready(Some(
+ Server {
+ endpoint: this.endpoint.clone(),
+ table_idents: vec![this.table_ident.clone()],
+ code: header.code,
+ msg: header.error,
+ }
+ .fail(),
+ ));
}
match response.output {
diff --git a/src/router/src/rule_based.rs b/src/router/src/rule_based.rs
index b3b4ce8b..e4201c7d 100644
--- a/src/router/src/rule_based.rs
+++ b/src/router/src/rule_based.rs
@@ -124,7 +124,7 @@ impl RuleBasedRouter {
}
}
- if let Some(hash_rule) = rule_list.hash_rules.get(0) {
+ if let Some(hash_rule) = rule_list.hash_rules.first() {
let total_shards = hash_rule.shards.len();
let hash_value = hash::hash_table(table);
let index = hash_value as usize % total_shards;
diff --git a/src/table_engine/src/partition/rule/df_adapter/extractor.rs
b/src/table_engine/src/partition/rule/df_adapter/extractor.rs
index 093bf499..ff6c393d 100644
--- a/src/table_engine/src/partition/rule/df_adapter/extractor.rs
+++ b/src/table_engine/src/partition/rule/df_adapter/extractor.rs
@@ -157,7 +157,7 @@ mod tests {
column: "col1".to_string(),
condition: PartitionCondition::Eq(Datum::Int32(42)),
};
- assert_eq!(partition_filter.get(0).unwrap(), &expected);
+ assert_eq!(partition_filter.first().unwrap(), &expected);
// Other expr will be rejected now.
let rejected_expr =
col("col1").gt(Expr::Literal(ScalarValue::Int32(Some(42))));
@@ -182,7 +182,7 @@ mod tests {
column: "col1".to_string(),
condition: PartitionCondition::In(vec![Datum::Int32(42),
Datum::Int32(38)]),
};
- assert_eq!(partition_filter.get(0).unwrap(), &expected);
+ assert_eq!(partition_filter.first().unwrap(), &expected);
}
#[test]
diff --git a/src/table_engine/src/partition/rule/df_adapter/mod.rs
b/src/table_engine/src/partition/rule/df_adapter/mod.rs
index a6048fa7..8e95f856 100644
--- a/src/table_engine/src/partition/rule/df_adapter/mod.rs
+++ b/src/table_engine/src/partition/rule/df_adapter/mod.rs
@@ -120,7 +120,7 @@ mod tests {
.locate_partitions_for_read(&valid_filters_1)
.unwrap();
- let partition_keys = vec![
+ let partition_keys = [
Datum::Int32(1),
Datum::String(StringBytes::from("test")),
Datum::UInt64(42),
@@ -189,7 +189,7 @@ mod tests {
};
// Build `RowGroup`
- let test_datums = vec![
+ let test_datums = [
vec![
Datum::Int32(1),
Datum::String(StringBytes::from("test1")),
diff --git a/src/table_engine/src/partition/rule/key.rs
b/src/table_engine/src/partition/rule/key.rs
index e6d4666a..a05ef011 100644
--- a/src/table_engine/src/partition/rule/key.rs
+++ b/src/table_engine/src/partition/rule/key.rs
@@ -387,7 +387,7 @@ mod tests {
/// as much as possible.
#[test]
fn test_partition_keys_read_adapter() {
- let datums = vec![
+ let datums = [
Datum::Int32(1),
Datum::String(StringBytes::copy_from_str(
"test_partition_keys_read_adapter_key0",
diff --git a/src/tools/src/bin/sst-metadata.rs
b/src/tools/src/bin/sst-metadata.rs
index 1a4cc070..4199ba8d 100644
--- a/src/tools/src/bin/sst-metadata.rs
+++ b/src/tools/src/bin/sst-metadata.rs
@@ -53,7 +53,7 @@ struct Args {
sort: SortBy,
}
-#[derive(Debug)]
+#[derive(Debug, Clone)]
enum SortBy {
/// Max Sequence number
Seq,
@@ -215,7 +215,7 @@ async fn run(args: Args) -> Result<()> {
file_stats.row_num += row_num;
let fields = file_metadata.schema().get_fields();
- for (_, row_group) in parquet_meta.row_groups().iter().enumerate() {
+ for row_group in parquet_meta.row_groups().iter() {
for i in 0..fields.len() {
let column_meta = row_group.column(i);
let field_name =
fields.get(i).unwrap().get_basic_info().name().to_string();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]