Skip to content

Commit

Permalink
fix: add custom (de)serialization methods for special float value (#1โ€ฆ
Browse files Browse the repository at this point in the history
โ€ฆ6258)

* fix: add custom (de)serialization for infinite float values

* fix: fix serialize and deserialize error for infinity float case

* test: add more tests for inf and nan

* fix

* fix: add borsh f32 and f64 replaced method for nan

* chore: patch borsh-rs to bypass NaN check

* make taplo happy

* refactor: put ordered float file in base

* fix: override ordered_float's json and borsh (de)serde methods to allow use NaN and inf

* taplo fmt

* test: add more test
  • Loading branch information
dqhl76 authored Sep 9, 2024
1 parent 72db96e commit 20c6964
Show file tree
Hide file tree
Showing 37 changed files with 2,324 additions and 46 deletions.
27 changes: 17 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/common/base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ memory-profiling = [
[dependencies]
async-backtrace = { workspace = true }
async-trait = { workspace = true }
borsh = { workspace = true }
bytesize = "1.1.0"
chrono = { workspace = true }
ctrlc = { version = "3.2.3", features = ["termination"] }
Expand All @@ -33,6 +34,8 @@ futures = { workspace = true }
libc = "0.2.153"
log = { workspace = true }
logcall = { workspace = true }
micromarshal = "0.5.0"
num-traits = "0.2.19"
num_cpus = "1.13.1"
once_cell = { workspace = true }
parking_lot = { workspace = true }
Expand All @@ -44,10 +47,12 @@ pprof = { version = "0.11.1", features = [
] }
prometheus-client = { workspace = true }
prometheus-parse = "0.2.3"
rand = { workspace = true, features = ["serde1"] }
regex = { workspace = true }
replace_with = "0.1.7"
semver = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
state = "0.5"
tikv-jemalloc-ctl = { workspace = true }
tikv-jemalloc-sys = "0.5.2"
Expand All @@ -62,6 +67,7 @@ procfs = { version = "^0.16" }
anyerror = { workspace = true }
anyhow = { workspace = true }
rand = { workspace = true }
serde_test = "1.0"

[build-dependencies]
databend-common-building = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions src/common/base/src/base/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

mod net;
mod ordered_float;
mod profiling;
mod progress;
mod select;
Expand All @@ -28,6 +29,7 @@ mod watch_notify;

pub use net::get_free_tcp_port;
pub use net::get_free_udp_port;
pub use ordered_float::OrderedFloat;
pub use profiling::Profiling;
pub use progress::Progress;
pub use progress::ProgressValues;
Expand Down
Loading

0 comments on commit 20c6964

Please sign in to comment.