Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(query): bump enum-as-inner 0.6 #17120

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading