diff --git a/Cargo.lock b/Cargo.lock index 4bf25278bfa6..eb8d53e71d4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2991,7 +2991,7 @@ version = "0.0.4" dependencies = [ "criterion", "derive-visitor", - "enum-as-inner 0.5.1", + "enum-as-inner", "ethnum", "fast-float2", "fastrace", @@ -3224,7 +3224,7 @@ dependencies = [ name = "databend-common-datavalues" version = "0.1.0" dependencies = [ - "enum-as-inner 0.5.1", + "enum-as-inner", "enum_dispatch", "serde", "serde_json", @@ -3294,7 +3294,7 @@ dependencies = [ "databend-common-io", "educe 0.4.23", "either", - "enum-as-inner 0.5.1", + "enum-as-inner", "ethnum", "futures", "geo", @@ -4029,7 +4029,7 @@ dependencies = [ "databend-storages-common-table-meta", "derive-visitor", "educe 0.4.23", - "enum-as-inner 0.5.1", + "enum-as-inner", "fastrace", "globiter", "indexmap 2.6.0", @@ -4175,7 +4175,7 @@ dependencies = [ "databend-storages-common-pruner", "databend-storages-common-session", "databend-storages-common-table-meta", - "enum-as-inner 0.5.1", + "enum-as-inner", "fastrace", "futures", "futures-util", @@ -4460,7 +4460,7 @@ dependencies = [ "databend-common-storages-parquet", "databend-storages-common-stage", "databend-storages-common-table-meta", - "enum-as-inner 0.5.1", + "enum-as-inner", "futures", "log", "opendal", @@ -5270,7 +5270,7 @@ dependencies = [ "databend-common-io", "databend-common-native", "databend-common-storage", - "enum-as-inner 0.5.1", + "enum-as-inner", "log", "parquet", "rmp-serde", @@ -5852,18 +5852,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "enum-as-inner" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "enum-as-inner" version = "0.6.0" @@ -7958,7 +7946,7 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner 0.6.0", + "enum-as-inner", "futures-channel", "futures-io", "futures-util", @@ -11526,7 +11514,7 @@ dependencies = [ "color-eyre", "colorchoice-clap", "csv", - "enum-as-inner 0.6.0", + "enum-as-inner", "env_logger 0.10.2", "itertools 0.12.1", "log", @@ -11554,7 +11542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c98923b046bc48046e3846b14a5fde5a059f681c7c367bd0ab96ebd3ecc33a71" dependencies = [ "anyhow", - "enum-as-inner 0.6.0", + "enum-as-inner", "semver", "serde", "strum 0.26.3", diff --git a/Cargo.toml b/Cargo.toml index 7cd1a9463d57..3090a2e5edc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -272,7 +272,7 @@ dyn-clone = "1.0.9" educe = "0.4" # FIXME: failed to upgrade to educe 0.6 either = "1.9" enquote = "1.1.0" -enum-as-inner = "0.5" # FIXME: failed to upgrade to enum-as-inner 0.6 +enum-as-inner = "0.6" enum_dispatch = "0.3.13" enumflags2 = { version = "0.7.7", features = ["serde"] } ethnum = { version = "1.5.0" } diff --git a/src/query/expression/src/expression.rs b/src/query/expression/src/expression.rs index ef32aeba4a17..031702c94bc1 100644 --- a/src/query/expression/src/expression.rs +++ b/src/query/expression/src/expression.rs @@ -429,7 +429,7 @@ impl Expr { } pub fn runtime_filter_supported_types(&self) -> bool { - self.data_type().remove_nullable().is_numeric() + self.data_type().remove_nullable().is_number() || self.data_type().remove_nullable().is_string() || self.data_type().remove_nullable().is_date() } diff --git a/src/query/expression/src/kernels/group_by.rs b/src/query/expression/src/kernels/group_by.rs index fac1a64a8054..a2ff4ac191e6 100644 --- a/src/query/expression/src/kernels/group_by.rs +++ b/src/query/expression/src/kernels/group_by.rs @@ -56,7 +56,7 @@ impl DataBlock { for hash_key_type in hash_key_types { let not_null_type = hash_key_type.remove_nullable(); - if not_null_type.is_numeric() + if not_null_type.is_number() || not_null_type.is_date_or_date_time() || not_null_type.is_decimal() { diff --git a/src/query/expression/src/types.rs b/src/query/expression/src/types.rs index 95ed56924541..3f95c23a636a 100755 --- a/src/query/expression/src/types.rs +++ b/src/query/expression/src/types.rs @@ -114,10 +114,6 @@ impl DataType { } } - pub fn is_nullable(&self) -> bool { - matches!(self, &DataType::Nullable(_)) - } - pub fn is_nullable_or_null(&self) -> bool { matches!(self, &DataType::Nullable(_) | &DataType::Null) } @@ -207,10 +203,6 @@ impl DataType { } } - pub fn is_numeric(&self) -> bool { - matches!(self, DataType::Number(_)) - } - #[inline] pub fn is_integer(&self) -> bool { match self { @@ -227,11 +219,6 @@ impl DataType { } } - #[inline] - pub fn is_decimal(&self) -> bool { - matches!(self, DataType::Decimal(_ty)) - } - #[inline] pub fn is_date_or_date_time(&self) -> bool { matches!(self, DataType::Timestamp | DataType::Date) diff --git a/src/query/expression/src/utils/block_debug.rs b/src/query/expression/src/utils/block_debug.rs index d6ffa2191cdc..6ff394a3c883 100644 --- a/src/query/expression/src/utils/block_debug.rs +++ b/src/query/expression/src/utils/block_debug.rs @@ -443,7 +443,7 @@ fn render_head( header.push(cell); - if field.data_type().is_numeric() { + if field.data_type().is_number() { aligns.push(CellAlignment::Right); } else { aligns.push(CellAlignment::Left); @@ -493,7 +493,7 @@ fn render_head( header.push(cell); - if field.data_type().is_numeric() { + if field.data_type().is_number() { aligns.push(CellAlignment::Right); } else { aligns.push(CellAlignment::Left); diff --git a/src/query/expression/tests/it/input_columns.rs b/src/query/expression/tests/it/input_columns.rs index ad76334fe7dd..d395fc4bf18f 100644 --- a/src/query/expression/tests/it/input_columns.rs +++ b/src/query/expression/tests/it/input_columns.rs @@ -29,7 +29,7 @@ fn test_input_columns() { let data_types = proxy.as_block().unwrap().data_types(); assert!(data_types[0].is_boolean()); assert!(data_types[1].is_string()); - assert!(data_types[2].is_numeric()); + assert!(data_types[2].is_number()); assert_eq!(proxy.iter().count(), 3); diff --git a/src/query/functions/src/scalars/map.rs b/src/query/functions/src/scalars/map.rs index d6f213223311..607fc9161144 100644 --- a/src/query/functions/src/scalars/map.rs +++ b/src/query/functions/src/scalars/map.rs @@ -590,7 +590,7 @@ fn check_map_arg_types(args_type: &[DataType]) -> Option { fn check_valid_map_key_type(key_type: &DataType) -> bool { key_type.is_boolean() || key_type.is_string() - || key_type.is_numeric() + || key_type.is_number() || key_type.is_decimal() || key_type.is_date_or_date_time() } diff --git a/src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs b/src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs index e110681f17d4..12412a7403d3 100644 --- a/src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs +++ b/src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs @@ -865,7 +865,7 @@ impl HashJoinBuildState { .zip(self.hash_join_state.hash_join_desc.probe_keys_rt.iter()) .filter_map(|(b, p)| p.as_ref().map(|(p, index)| (b, p, index))) { - if !build_key.data_type().remove_nullable().is_numeric() + if !build_key.data_type().remove_nullable().is_number() && !build_key.data_type().remove_nullable().is_string() { continue; @@ -942,7 +942,7 @@ impl HashJoinBuildState { build_key: &Expr, probe_key: &Expr, ) -> Result<()> { - if !build_key.data_type().remove_nullable().is_numeric() + if !build_key.data_type().remove_nullable().is_number() && !build_key.data_type().remove_nullable().is_string() { return Ok(());