Skip to content

Commit

Permalink
bump enum-as-inner
Browse files Browse the repository at this point in the history
  • Loading branch information
forsaken628 committed Dec 26, 2024
1 parent ff78344 commit 263db7d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 44 deletions.
32 changes: 10 additions & 22 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl<Index: ColumnIndex> Expr<Index> {
}

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()
}
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/kernels/group_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
13 changes: 0 additions & 13 deletions src/query/expression/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/query/expression/src/utils/block_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/tests/it/input_columns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/query/functions/src/scalars/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ fn check_map_arg_types(args_type: &[DataType]) -> Option<DataType> {
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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -942,7 +942,7 @@ impl HashJoinBuildState {
build_key: &Expr,
probe_key: &Expr<String>,
) -> 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(());
Expand Down

0 comments on commit 263db7d

Please sign in to comment.