Skip to content

Commit 7971ecf

Browse files
committed
chore(query): lint
1 parent ad2f709 commit 7971ecf

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

src/common/hashtable/src/hash_table_key.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ primitive_hasher_impl!(u16);
6262
primitive_hasher_impl!(u32);
6363
primitive_hasher_impl!(u64);
6464

65-
6665
impl HashTableKeyable for u128 {
6766
const BEFORE_EQ_HASH: bool = false;
6867
#[inline(always)]

src/common/hashtable/src/keys_ref.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use std::hash::Hasher;
1616

1717
use ahash::AHasher;
18+
1819
use super::HashTableKeyable;
1920

2021
#[derive(Clone, Copy)]

src/common/hashtable/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ mod hash_table_entity;
3636
mod hash_table_grower;
3737
mod hash_table_iter;
3838
mod hash_table_key;
39-
mod two_level_hash_table;
4039
mod keys_ref;
40+
mod two_level_hash_table;
4141

4242
pub use keys_ref::KeysRef;
4343

src/query/functions/src/scalars/conditionals/in_basic.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use common_datavalues::prelude::*;
1818
use common_datavalues::type_coercion::numerical_coercion;
1919
use common_exception::ErrorCode;
2020
use common_exception::Result;
21+
use common_hashtable::HashSetWithStackMemory;
2122
use common_hashtable::KeysRef;
2223
use ordered_float::OrderedFloat;
2324

@@ -27,8 +28,6 @@ use crate::scalars::FunctionContext;
2728
use crate::scalars::FunctionDescription;
2829
use crate::scalars::FunctionFeatures;
2930

30-
use common_hashtable::HashSetWithStackMemory;
31-
3231
#[derive(Clone)]
3332
pub struct InFunction<const NEGATED: bool> {
3433
is_null: bool,
@@ -82,7 +81,6 @@ macro_rules! scalar_contains {
8281
}};
8382
}
8483

85-
8684
macro_rules! bool_contains {
8785
($T: ident, $INPUT_COL: expr, $ROWS: expr, $COLUMNS: expr, $CAST_TYPE: ident, $FUNC_CTX: expr) => {{
8886
let mut builder: ColumnBuilder<bool> = ColumnBuilder::with_capacity($ROWS);
@@ -92,24 +90,23 @@ macro_rules! bool_contains {
9290
let col_viewer = $T::try_create_viewer(&col)?;
9391
if col_viewer.valid_at(0) {
9492
let val = col_viewer.value_at(0);
95-
vals |= 1 << (val as u8 + 1);
93+
vals |= 1 << (val as u8 + 1);
9694
}
9795
}
9896
let input_viewer = $T::try_create_viewer(&$INPUT_COL)?;
9997
for (row, val) in input_viewer.iter().enumerate() {
100-
let contains = ((vals >> (val as u8 + 1)) & 1) > 0;
98+
let contains = ((vals >> (val as u8 + 1)) & 1) > 0;
10199
let valid = input_viewer.valid_at(row);
102100
builder.append(valid && ((contains && !NEGATED) || (!contains && NEGATED)));
103101
}
104102
return Ok(builder.build($ROWS));
105103
}};
106104
}
107105

108-
109106
macro_rules! string_contains {
110107
($T: ident, $INPUT_COL: expr, $ROWS: expr, $COLUMNS: expr, $CAST_TYPE: ident, $FUNC_CTX: expr) => {{
111108
let mut builder: ColumnBuilder<bool> = ColumnBuilder::with_capacity($ROWS);
112-
let mut vals_set: HashSetWithStackMemory<64, KeysRef> = HashSetWithStackMemory::create();
109+
let mut vals_set: HashSetWithStackMemory<64, KeysRef> = HashSetWithStackMemory::create();
113110
let mut inserted = false;
114111
for col in &$COLUMNS[1..] {
115112
let col = cast_column_field(col, col.data_type(), &$CAST_TYPE, &$FUNC_CTX)?;
@@ -134,7 +131,8 @@ macro_rules! string_contains {
134131
macro_rules! float_contains {
135132
($T: ident, $INPUT_COL: expr, $ROWS: expr, $COLUMNS: expr, $CAST_TYPE: ident, $FUNC_CTX: expr) => {{
136133
let mut builder: ColumnBuilder<bool> = ColumnBuilder::with_capacity($ROWS);
137-
let mut vals_set: HashSetWithStackMemory<64, OrderedFloat<$T>> = HashSetWithStackMemory::create();
134+
let mut vals_set: HashSetWithStackMemory<64, OrderedFloat<$T>> =
135+
HashSetWithStackMemory::create();
138136
let mut inserted = false;
139137

140138
for col in &$COLUMNS[1..] {

0 commit comments

Comments
 (0)