diff --git a/common/ast/src/ast/expr.rs b/common/ast/src/ast/expr.rs index b6e5198566a7..95151a2bca39 100644 --- a/common/ast/src/ast/expr.rs +++ b/common/ast/src/ast/expr.rs @@ -245,14 +245,14 @@ pub enum TypeName { Variant, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum TrimWhere { Both, Leading, Trailing, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum BinaryOperator { Plus, Minus, @@ -285,7 +285,7 @@ pub enum BinaryOperator { BitwiseXor, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum UnaryOperator { Plus, Minus, diff --git a/common/ast/src/ast/mod.rs b/common/ast/src/ast/mod.rs index e9f0806f2556..803156848c4c 100644 --- a/common/ast/src/ast/mod.rs +++ b/common/ast/src/ast/mod.rs @@ -26,7 +26,7 @@ pub use statements::*; use crate::parser::token::Token; // Identifier of table name or column name. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Identifier<'a> { pub name: String, pub quote: Option, diff --git a/common/ast/src/ast/query.rs b/common/ast/src/ast/query.rs index b779eae0925c..935ea643e7ce 100644 --- a/common/ast/src/ast/query.rs +++ b/common/ast/src/ast/query.rs @@ -77,7 +77,7 @@ pub enum SetExpr<'a> { SetOperation(Box>), } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum SetOperator { Union, Except, @@ -112,7 +112,7 @@ pub type QualifiedName<'a> = Vec>; /// Indirection of a select result, like a part of `db.table.column`. /// Can be a database name, table name, field name or wildcard star(`*`). -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Indirection<'a> { // Field name Identifier(Identifier<'a>), @@ -152,7 +152,7 @@ pub enum TableReference<'a> { Join(Join<'a>), } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct TableAlias<'a> { pub name: Identifier<'a>, pub columns: Vec>, @@ -166,7 +166,7 @@ pub struct Join<'a> { pub right: Box>, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum JoinOperator { Inner, // Outer joins can not work with `JoinCondition::None` diff --git a/common/ast/src/ast/statements/database.rs b/common/ast/src/ast/statements/database.rs index 9184e2d7668b..774268d3f0c2 100644 --- a/common/ast/src/ast/statements/database.rs +++ b/common/ast/src/ast/statements/database.rs @@ -35,7 +35,7 @@ impl Display for ShowDatabasesStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct ShowCreateDatabaseStmt<'a> { pub catalog: Option>, pub database: Identifier<'a>, @@ -50,7 +50,7 @@ impl Display for ShowCreateDatabaseStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct CreateDatabaseStmt<'a> { pub if_not_exists: bool, pub catalog: Option>, @@ -74,7 +74,7 @@ impl Display for CreateDatabaseStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DropDatabaseStmt<'a> { pub if_exists: bool, pub catalog: Option>, @@ -93,7 +93,7 @@ impl Display for DropDatabaseStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct AlterDatabaseStmt<'a> { pub if_exists: bool, pub catalog: Option>, @@ -118,12 +118,12 @@ impl Display for AlterDatabaseStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum AlterDatabaseAction<'a> { RenameDatabase { new_db: Identifier<'a> }, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum DatabaseEngine { Default, Github(String), @@ -139,7 +139,7 @@ impl Display for DatabaseEngine { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct SQLProperty { pub name: String, pub value: String, diff --git a/common/ast/src/ast/statements/explain.rs b/common/ast/src/ast/statements/explain.rs index 0e4ba8eae220..8851edbcad25 100644 --- a/common/ast/src/ast/statements/explain.rs +++ b/common/ast/src/ast/statements/explain.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum ExplainKind { Syntax, Graph, diff --git a/common/ast/src/ast/statements/kill.rs b/common/ast/src/ast/statements/kill.rs index c410c947b460..1c61b445b951 100644 --- a/common/ast/src/ast/statements/kill.rs +++ b/common/ast/src/ast/statements/kill.rs @@ -15,7 +15,7 @@ use std::fmt::Display; use std::fmt::Formatter; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum KillTarget { Query, Connection, diff --git a/common/ast/src/ast/statements/stage.rs b/common/ast/src/ast/statements/stage.rs index 5650ff537b24..8c9bbc8dc753 100644 --- a/common/ast/src/ast/statements/stage.rs +++ b/common/ast/src/ast/statements/stage.rs @@ -16,7 +16,7 @@ use std::collections::BTreeMap; use std::fmt::Display; use std::fmt::Formatter; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct CreateStageStmt { pub if_not_exists: bool, pub stage_name: String, diff --git a/common/ast/src/ast/statements/table.rs b/common/ast/src/ast/statements/table.rs index eab3b45d5133..c602c31fdd14 100644 --- a/common/ast/src/ast/statements/table.rs +++ b/common/ast/src/ast/statements/table.rs @@ -53,7 +53,7 @@ impl Display for ShowTablesStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct ShowCreateTableStmt<'a> { pub catalog: Option>, pub database: Option>, @@ -177,7 +177,7 @@ impl Display for CreateTableSource<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DescribeTableStmt<'a> { pub catalog: Option>, pub database: Option>, @@ -196,7 +196,7 @@ impl Display for DescribeTableStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DropTableStmt<'a> { pub if_exists: bool, pub catalog: Option>, @@ -226,7 +226,7 @@ impl Display for DropTableStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct UndropTableStmt<'a> { pub catalog: Option>, pub database: Option>, @@ -296,7 +296,7 @@ impl Display for AlterTableAction<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct RenameTableStmt<'a> { pub if_exists: bool, pub catalog: Option>, @@ -331,7 +331,7 @@ impl Display for RenameTableStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct TruncateTableStmt<'a> { pub catalog: Option>, pub database: Option>, @@ -357,7 +357,7 @@ impl Display for TruncateTableStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct OptimizeTableStmt<'a> { pub catalog: Option>, pub database: Option>, @@ -383,7 +383,7 @@ impl Display for OptimizeTableStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct ExistsTableStmt<'a> { pub catalog: Option>, pub database: Option>, @@ -403,7 +403,7 @@ impl Display for ExistsTableStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Engine { Null, Memory, @@ -426,7 +426,7 @@ impl Display for Engine { } } -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum OptimizeTableAction { All, Purge, @@ -443,7 +443,7 @@ impl Display for OptimizeTableAction { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum TableOption { Engine(Engine), Comment(String), diff --git a/common/ast/src/ast/statements/user.rs b/common/ast/src/ast/statements/user.rs index 2401942e43a3..4679e9144e0f 100644 --- a/common/ast/src/ast/statements/user.rs +++ b/common/ast/src/ast/statements/user.rs @@ -24,7 +24,7 @@ use common_meta_types::UserPrivilegeType; use crate::ast::write_comma_separated_list; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct CreateUserStmt { pub if_not_exists: bool, pub user: UserIdentity, @@ -51,7 +51,7 @@ impl Display for CreateUserStmt { } } -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct AuthOption { pub auth_type: Option, pub password: Option, @@ -70,7 +70,7 @@ impl Display for AuthOption { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct AlterUserStmt { // None means current user pub user: Option, @@ -101,7 +101,7 @@ impl Display for AlterUserStmt { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct GrantStmt { pub source: AccountMgrSource, pub principal: PrincipalIdentity, @@ -117,7 +117,7 @@ impl Display for GrantStmt { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct RevokeStmt { pub source: AccountMgrSource, pub principal: PrincipalIdentity, @@ -133,7 +133,7 @@ impl Display for RevokeStmt { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum AccountMgrSource { Role { role: String, @@ -147,14 +147,14 @@ pub enum AccountMgrSource { }, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum AccountMgrLevel { Global, Database(Option), Table(Option, String), } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum RoleOption { TenantSetting, NoTenantSetting, diff --git a/common/ast/src/ast/statements/view.rs b/common/ast/src/ast/statements/view.rs index dc169b71e02f..3ddb024d3d35 100644 --- a/common/ast/src/ast/statements/view.rs +++ b/common/ast/src/ast/statements/view.rs @@ -67,7 +67,7 @@ impl Display for AlterViewStmt<'_> { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DropViewStmt<'a> { pub if_exists: bool, pub catalog: Option>, diff --git a/common/ast/src/error.rs b/common/ast/src/error.rs index 406992d8864d..0fb314ef04c5 100644 --- a/common/ast/src/error.rs +++ b/common/ast/src/error.rs @@ -44,7 +44,7 @@ pub struct Error<'a> { } /// ErrorKind is the error type returned from parser. -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum ErrorKind { /// Error generated by `match_token` function ExpectToken(TokenKind), @@ -73,7 +73,7 @@ impl<'a> Backtrace<'a> { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct BacktraceInner<'a> { /// The next token when encountering an error. span: Token<'a>, diff --git a/common/ast/src/parser/token.rs b/common/ast/src/parser/token.rs index c7da877826c6..d921fc3b0313 100644 --- a/common/ast/src/parser/token.rs +++ b/common/ast/src/parser/token.rs @@ -21,7 +21,7 @@ use logos::Span; pub use self::TokenKind::*; use crate::DisplayError; -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Eq)] pub struct Token<'a> { pub source: &'a str, pub kind: TokenKind, diff --git a/common/ast/src/udfs/udf_parser.rs b/common/ast/src/udfs/udf_parser.rs index 2b844c6de9ab..ad79f0d7a57d 100644 --- a/common/ast/src/udfs/udf_parser.rs +++ b/common/ast/src/udfs/udf_parser.rs @@ -79,7 +79,7 @@ impl UDFParser { return Ok(()); } - return Err(ErrorCode::SyntaxException(format!( + Err(ErrorCode::SyntaxException(format!( "{}{}", if params_not_declared.is_empty() { "".to_string() @@ -91,7 +91,7 @@ impl UDFParser { } else { format!("Parameters are not used: {:?}", params_not_used) }, - ))); + ))) } } diff --git a/common/base/src/mem_allocator/malloc_size.rs b/common/base/src/mem_allocator/malloc_size.rs index ed3aef9eb7c4..631e609170e4 100644 --- a/common/base/src/mem_allocator/malloc_size.rs +++ b/common/base/src/mem_allocator/malloc_size.rs @@ -307,7 +307,7 @@ impl MallocShallowSizeOf for std::collections::VecDeque { if ops.has_malloc_enclosing_size_of() { if let Some(front) = self.front() { // The front element is an interior pointer. - unsafe { ops.malloc_enclosing_size_of(&*front) } + unsafe { ops.malloc_enclosing_size_of(front) } } else { // This assumes that no memory is allocated when the VecDeque is empty. 0 diff --git a/common/datablocks/src/kernels/data_block_filter.rs b/common/datablocks/src/kernels/data_block_filter.rs index a133a9c0c564..d212cbed7074 100644 --- a/common/datablocks/src/kernels/data_block_filter.rs +++ b/common/datablocks/src/kernels/data_block_filter.rs @@ -118,10 +118,10 @@ impl DataBlock { return Ok(Arc::new(col)); }, { - return Err(ErrorCode::BadDataValueType(format!( + Err(ErrorCode::BadDataValueType(format!( "Filter predict column does not support type '{:?}'", data_type_id - ))); + ))) }) } } diff --git a/common/datablocks/src/kernels/data_block_group_by_hash.rs b/common/datablocks/src/kernels/data_block_group_by_hash.rs index 94bd67091093..e58f96f8a068 100644 --- a/common/datablocks/src/kernels/data_block_group_by_hash.rs +++ b/common/datablocks/src/kernels/data_block_group_by_hash.rs @@ -176,7 +176,7 @@ impl HashMethodKind { } // A special case for Group by String -#[derive(Debug, Clone, Default, PartialEq)] +#[derive(Debug, Clone, Default, PartialEq, Eq)] pub struct HashMethodSingleString {} impl HashMethodSingleString { @@ -222,7 +222,7 @@ impl HashMethod for HashMethodSingleString { } } -#[derive(Debug, Clone, Default, PartialEq)] +#[derive(Debug, Clone, Default, PartialEq, Eq)] pub struct HashMethodSerializer {} impl HashMethodSerializer { diff --git a/common/datablocks/src/kernels/data_block_sort.rs b/common/datablocks/src/kernels/data_block_sort.rs index 9d04ba73ccc6..a28bea9adf55 100644 --- a/common/datablocks/src/kernels/data_block_sort.rs +++ b/common/datablocks/src/kernels/data_block_sort.rs @@ -195,10 +195,10 @@ fn build_compare(left: &dyn Array, right: &dyn Array) -> ArrowResult arrow_ord::build_compare(left, right), diff --git a/common/datavalues/src/data_value.rs b/common/datavalues/src/data_value.rs index ab4ac75450fd..a4b0ed8739a4 100644 --- a/common/datavalues/src/data_value.rs +++ b/common/datavalues/src/data_value.rs @@ -48,7 +48,7 @@ pub enum DataValue { impl Eq for DataValue {} -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, MallocSizeOf)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, MallocSizeOf)] pub enum ValueType { Null, Boolean, diff --git a/common/datavalues/src/data_value_operator.rs b/common/datavalues/src/data_value_operator.rs index 53407683e80d..7a9b768ec59b 100644 --- a/common/datavalues/src/data_value_operator.rs +++ b/common/datavalues/src/data_value_operator.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum DataValueAggregateOperator { Min, Max, diff --git a/common/datavalues/src/types/mod.rs b/common/datavalues/src/types/mod.rs index f7601516efff..b6009909c9ff 100644 --- a/common/datavalues/src/types/mod.rs +++ b/common/datavalues/src/types/mod.rs @@ -41,7 +41,6 @@ mod type_factory; pub use arithmetics_type::*; pub use data_type::*; pub use date_converter::*; -pub use date_converter::*; pub use deserializations::*; pub use eq::*; pub use serializations::TypeSerializer; diff --git a/common/datavalues/src/types/type_array.rs b/common/datavalues/src/types/type_array.rs index 55078c72fd41..c55fb3ed49b9 100644 --- a/common/datavalues/src/types/type_array.rs +++ b/common/datavalues/src/types/type_array.rs @@ -87,10 +87,10 @@ impl DataType for ArrayType { return Ok(Arc::new(ConstColumn::new(column, size))); } - return Result::Err(ErrorCode::BadDataValueType(format!( + Err(ErrorCode::BadDataValueType(format!( "Unexpected type:{:?} to generate list column", data.value_type() - ))); + ))) } fn create_column(&self, data: &[DataValue]) -> Result { diff --git a/common/datavalues/src/types/type_date.rs b/common/datavalues/src/types/type_date.rs index 994fc80e2455..0ad2bb52acd4 100644 --- a/common/datavalues/src/types/type_date.rs +++ b/common/datavalues/src/types/type_date.rs @@ -34,7 +34,7 @@ pub const DATE_MIN: i32 = -354285; #[inline] pub fn check_date(days: i32) -> Result<()> { - if days >= DATE_MIN && days <= DATE_MAX { + if (DATE_MIN..=DATE_MAX).contains(&days) { return Ok(()); } Err(ErrorCode::InvalidDate( diff --git a/common/datavalues/src/types/type_struct.rs b/common/datavalues/src/types/type_struct.rs index efe516ff4a22..753900f56db6 100644 --- a/common/datavalues/src/types/type_struct.rs +++ b/common/datavalues/src/types/type_struct.rs @@ -99,10 +99,11 @@ impl DataType for StructType { let struct_column = StructColumn::from_data(cols, DataTypeImpl::Struct(self.clone())); return Ok(Arc::new(ConstColumn::new(Arc::new(struct_column), size))); } - return Result::Err(ErrorCode::BadDataValueType(format!( + + Err(ErrorCode::BadDataValueType(format!( "Unexpected type:{:?} to generate list column", data.value_type() - ))); + ))) } fn arrow_type(&self) -> ArrowType { diff --git a/common/datavalues/src/types/type_timestamp.rs b/common/datavalues/src/types/type_timestamp.rs index 6376bf48e04c..c9eb87637879 100644 --- a/common/datavalues/src/types/type_timestamp.rs +++ b/common/datavalues/src/types/type_timestamp.rs @@ -40,7 +40,7 @@ pub const MICROSECONDS: i64 = 1_000_000; #[inline] pub fn check_timestamp(micros: i64) -> Result<()> { - if micros >= TIMESTAMP_MIN && micros <= TIMESTAMP_MAX { + if (TIMESTAMP_MIN..=TIMESTAMP_MAX).contains(µs) { return Ok(()); } Err(ErrorCode::InvalidTimestamp( diff --git a/common/exception/src/exception_into.rs b/common/exception/src/exception_into.rs index c7391f921482..a6710d00fa03 100644 --- a/common/exception/src/exception_into.rs +++ b/common/exception/src/exception_into.rs @@ -159,7 +159,7 @@ impl From for ErrorCode { } // === ser/de to/from tonic::Status === -#[derive(thiserror::Error, serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq)] +#[derive(thiserror::Error, serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] pub struct SerializedError { code: u16, message: String, diff --git a/common/functions/src/rdoc/function_docs.rs b/common/functions/src/rdoc/function_docs.rs index 484c4656e669..021fd1a46035 100644 --- a/common/functions/src/rdoc/function_docs.rs +++ b/common/functions/src/rdoc/function_docs.rs @@ -14,7 +14,7 @@ use serde::Serialize; -#[derive(Clone, Debug, PartialEq, Serialize, Default)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Default)] pub struct FunctionDocs { // Function Category pub category: String, diff --git a/common/functions/src/scalars/expressions/cast_from_variant.rs b/common/functions/src/scalars/expressions/cast_from_variant.rs index 974334d571a9..519bc16d6a01 100644 --- a/common/functions/src/scalars/expressions/cast_from_variant.rs +++ b/common/functions/src/scalars/expressions/cast_from_variant.rs @@ -190,11 +190,11 @@ pub fn cast_from_variant( return Ok((builder.build(size), Some(bitmap.into()))); } _ => { - return Err(ErrorCode::BadDataValueType(format!( + Err(ErrorCode::BadDataValueType(format!( "Unsupported cast variant value to {}", data_type.data_type_id() - ))); + ))) } } - }); + }) } diff --git a/common/functions/src/scalars/expressions/cast_with_type.rs b/common/functions/src/scalars/expressions/cast_with_type.rs index 390db4cfaedb..e8e241dbeed6 100644 --- a/common/functions/src/scalars/expressions/cast_with_type.rs +++ b/common/functions/src/scalars/expressions/cast_with_type.rs @@ -249,10 +249,10 @@ pub fn cast_to_variant( return Ok((builder.build(size), None)); } // other data types can't automatically casted to variant - return Err(ErrorCode::BadDataValueType(format!( + Err(ErrorCode::BadDataValueType(format!( "Expression type does not match column data type, expecting VARIANT but got {}", from_type.data_type_id() - ))); + ))) } pub fn cast_to_timestamp( diff --git a/common/functions/src/scalars/function_features.rs b/common/functions/src/scalars/function_features.rs index 5c6b0a88096c..1238662fdee9 100644 --- a/common/functions/src/scalars/function_features.rs +++ b/common/functions/src/scalars/function_features.rs @@ -14,7 +14,7 @@ use serde::Serialize; -#[derive(Clone, Debug, PartialEq, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] pub struct FunctionFeatures { pub is_deterministic: bool, pub negative_function_name: Option, diff --git a/common/functions/src/scalars/semi_structureds/as_type.rs b/common/functions/src/scalars/semi_structureds/as_type.rs index d0996273accd..b9ed09916a32 100644 --- a/common/functions/src/scalars/semi_structureds/as_type.rs +++ b/common/functions/src/scalars/semi_structureds/as_type.rs @@ -150,12 +150,10 @@ impl Function for AsFunction { bitmap.into(), )); } - _ => { - return Err(ErrorCode::UnknownFunction(format!( - "Unsupported Function {} as {}", - self.display_name, self.type_id - ))); - } + _ => Err(ErrorCode::UnknownFunction(format!( + "Unsupported Function {} as {}", + self.display_name, self.type_id + ))), } } } diff --git a/common/functions/src/scalars/strings/hex.rs b/common/functions/src/scalars/strings/hex.rs index 91dee529619a..b0c3faa4c414 100644 --- a/common/functions/src/scalars/strings/hex.rs +++ b/common/functions/src/scalars/strings/hex.rs @@ -108,12 +108,10 @@ impl Function for HexFunction { }); Ok(Arc::new(StringColumn::from_owned_iterator(iter))) } - _ => { - return Err(ErrorCode::IllegalDataType(format!( - "Expected integer but got {}", - columns[0].data_type().data_type_id() - ))); - } + _ => Err(ErrorCode::IllegalDataType(format!( + "Expected integer but got {}", + columns[0].data_type().data_type_id() + ))), } } } diff --git a/common/grpc/src/dns_resolver.rs b/common/grpc/src/dns_resolver.rs index 6e2975e00e04..5bb0897a5e24 100644 --- a/common/grpc/src/dns_resolver.rs +++ b/common/grpc/src/dns_resolver.rs @@ -214,7 +214,7 @@ impl ConnectionFactory { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] pub enum GrpcConnectionError { #[error("invalid uri: {uri}, error: {source}")] InvalidUri { diff --git a/common/io/src/configs.rs b/common/io/src/configs.rs index f4cb710b0e87..94d35484f465 100644 --- a/common/io/src/configs.rs +++ b/common/io/src/configs.rs @@ -23,7 +23,7 @@ use super::utils::mask_string; pub static AWS_S3_ENDPOINT: &str = "https://s3.amazonaws.com"; /// Config for storage backend. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct StorageConfig { pub num_cpus: u64, diff --git a/common/io/src/format_settings.rs b/common/io/src/format_settings.rs index d38860de5f66..f37712c63899 100644 --- a/common/io/src/format_settings.rs +++ b/common/io/src/format_settings.rs @@ -20,7 +20,7 @@ use common_exception::Result; use serde::Deserialize; use serde::Serialize; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct FormatSettings { pub record_delimiter: Vec, pub field_delimiter: Vec, @@ -62,7 +62,7 @@ impl Default for FormatSettings { } } -#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq, Eq)] pub enum Compression { None, Auto, diff --git a/common/meta/api/src/schema_api_test_suite.rs b/common/meta/api/src/schema_api_test_suite.rs index 39dd7ce4ce98..974b4693ef1a 100644 --- a/common/meta/api/src/schema_api_test_suite.rs +++ b/common/meta/api/src/schema_api_test_suite.rs @@ -1143,7 +1143,7 @@ impl SchemaApiTestSuite { table_meta: table_meta(created_on), }; let tb_ident_2 = { - let tb_ident_2 = { + { let old_db = mt.get_database(Self::req_get_db(tenant, db_name)).await?; let res = mt.create_table(req.clone()).await?; let cur_db = mt.get_database(Self::req_get_db(tenant, db_name)).await?; @@ -1165,8 +1165,7 @@ impl SchemaApiTestSuite { }; assert_eq!(want, got.as_ref().clone(), "get created table"); ident - }; - tb_ident_2 + } }; expected_tb_count += 1; diff --git a/common/meta/app/src/schema/database.rs b/common/meta/app/src/schema/database.rs index 6de4869421c3..c0c42f610581 100644 --- a/common/meta/app/src/schema/database.rs +++ b/common/meta/app/src/schema/database.rs @@ -154,7 +154,7 @@ impl Display for DbIdList { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateDatabaseReq { pub if_not_exists: bool, pub name_ident: DatabaseNameIdent, @@ -176,7 +176,7 @@ pub struct CreateDatabaseReply { pub db_id: u64, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RenameDatabaseReq { pub if_exists: bool, pub name_ident: DatabaseNameIdent, @@ -193,10 +193,10 @@ impl Display for RenameDatabaseReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RenameDatabaseReply {} -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropDatabaseReq { pub if_exists: bool, pub name_ident: DatabaseNameIdent, @@ -212,10 +212,10 @@ impl Display for DropDatabaseReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropDatabaseReply {} -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UndropDatabaseReq { pub name_ident: DatabaseNameIdent, } @@ -239,10 +239,10 @@ impl UndropDatabaseReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UndropDatabaseReply {} -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct GetDatabaseReq { pub inner: DatabaseNameIdent, } @@ -266,7 +266,7 @@ impl GetDatabaseReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ListDatabaseReq { pub tenant: String, } diff --git a/common/meta/app/src/schema/table.rs b/common/meta/app/src/schema/table.rs index d39488f5a38d..f7b5d06ef47c 100644 --- a/common/meta/app/src/schema/table.rs +++ b/common/meta/app/src/schema/table.rs @@ -342,7 +342,7 @@ impl Display for TableIdList { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateTableReq { pub if_not_exists: bool, pub name_ident: TableNameIdent, @@ -380,7 +380,7 @@ pub struct CreateTableReply { pub table_id: u64, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropTableReq { pub if_exists: bool, pub name_ident: TableNameIdent, @@ -411,10 +411,10 @@ impl Display for DropTableReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropTableReply {} -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UndropTableReq { pub name_ident: TableNameIdent, } @@ -443,10 +443,10 @@ impl Display for UndropTableReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UndropTableReply {} -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RenameTableReq { pub if_exists: bool, pub name_ident: TableNameIdent, @@ -480,12 +480,12 @@ impl Display for RenameTableReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RenameTableReply { pub table_id: u64, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UpsertTableOptionReq { pub table_id: u64, pub seq: MatchSeq, @@ -497,7 +497,7 @@ pub struct UpsertTableOptionReq { pub options: HashMap>, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UpdateTableMetaReq { pub table_id: u64, pub seq: MatchSeq, @@ -528,13 +528,13 @@ impl Display for UpsertTableOptionReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UpsertTableOptionReply {} -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UpdateTableMetaReply {} -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct GetTableReq { pub inner: TableNameIdent, } @@ -565,7 +565,7 @@ impl GetTableReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ListTableReq { pub inner: DatabaseNameIdent, } @@ -602,7 +602,7 @@ impl Display for CountTablesKey { } /// count tables for a tenant -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CountTablesReq { pub tenant: String, } diff --git a/common/meta/raft-store/src/config.rs b/common/meta/raft-store/src/config.rs index abecfa0a596b..500e528a3724 100644 --- a/common/meta/raft-store/src/config.rs +++ b/common/meta/raft-store/src/config.rs @@ -28,7 +28,7 @@ pub static DATABEND_COMMIT_VERSION: Lazy = Lazy::new(|| { let rustc_semver = option_env!("VERGEN_RUSTC_SEMVER"); let timestamp = option_env!("VERGEN_BUILD_TIMESTAMP"); - let ver = match (build_semver, git_sha, rustc_semver, timestamp) { + match (build_semver, git_sha, rustc_semver, timestamp) { #[cfg(not(feature = "simd"))] (Some(v1), Some(v2), Some(v3), Some(v4)) => format!("{}-{}({}-{})", v1, v2, v3, v4), #[cfg(feature = "simd")] @@ -36,11 +36,10 @@ pub static DATABEND_COMMIT_VERSION: Lazy = Lazy::new(|| { format!("{}-{}-simd({}-{})", v1, v2, v3, v4) } _ => String::new(), - }; - ver + } }); -#[derive(Clone, Debug, PartialEq, serde::Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize)] pub struct RaftConfig { /// Identify a config. /// This is only meant to make debugging easier with more than one Config involved. diff --git a/common/meta/raft-store/src/state/raft_state_kv.rs b/common/meta/raft-store/src/state/raft_state_kv.rs index cb578ab12fba..07c39684e72d 100644 --- a/common/meta/raft-store/src/state/raft_state_kv.rs +++ b/common/meta/raft-store/src/state/raft_state_kv.rs @@ -25,7 +25,7 @@ use serde::Deserialize; use serde::Serialize; use sled::IVec; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub enum RaftStateKey { /// The node id. Id, diff --git a/common/meta/raft-store/src/state_machine/client_last_resp.rs b/common/meta/raft-store/src/state_machine/client_last_resp.rs index c9cde8aa0729..5a331e5e1dba 100644 --- a/common/meta/raft-store/src/state_machine/client_last_resp.rs +++ b/common/meta/raft-store/src/state_machine/client_last_resp.rs @@ -20,7 +20,7 @@ use serde::Serialize; /// raft state: A mapping of client serial IDs to their state info: /// (serial, RaftResponse) /// This is used to de-dup client request, to impl idempotent operations. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct ClientLastRespValue { pub req_serial_num: u64, pub res: AppliedState, diff --git a/common/meta/raft-store/src/state_machine/log_meta.rs b/common/meta/raft-store/src/state_machine/log_meta.rs index a96af37af60b..8dabf5ab4222 100644 --- a/common/meta/raft-store/src/state_machine/log_meta.rs +++ b/common/meta/raft-store/src/state_machine/log_meta.rs @@ -24,7 +24,7 @@ use serde::Deserialize; use serde::Serialize; use sled::IVec; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub enum LogMetaKey { /// The last purged log id in the log. /// @@ -33,7 +33,7 @@ pub enum LogMetaKey { /// Because raft replication requires logs to be consecutive. LastPurged, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, derive_more::TryInto)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, derive_more::TryInto)] pub enum LogMetaValue { LogId(LogId), } diff --git a/common/meta/raft-store/src/state_machine/state_machine_meta.rs b/common/meta/raft-store/src/state_machine/state_machine_meta.rs index 4d70a63382b1..f56b200da0cd 100644 --- a/common/meta/raft-store/src/state_machine/state_machine_meta.rs +++ b/common/meta/raft-store/src/state_machine/state_machine_meta.rs @@ -25,7 +25,7 @@ use serde::Deserialize; use serde::Serialize; use sled::IVec; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub enum StateMachineMetaKey { /// The last applied log id in the state machine. LastApplied, @@ -36,7 +36,7 @@ pub enum StateMachineMetaKey { /// The last membership config LastMembership, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, derive_more::TryInto)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, derive_more::TryInto)] pub enum StateMachineMetaValue { LogId(LogId), Bool(bool), diff --git a/common/meta/sled-store/tests/it/testing/fake_state_machine_meta.rs b/common/meta/sled-store/tests/it/testing/fake_state_machine_meta.rs index 85520a75d3f4..d4b92ece94fd 100644 --- a/common/meta/sled-store/tests/it/testing/fake_state_machine_meta.rs +++ b/common/meta/sled-store/tests/it/testing/fake_state_machine_meta.rs @@ -23,7 +23,7 @@ use serde::Deserialize; use serde::Serialize; use sled::IVec; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub enum StateMachineMetaKey { /// The last applied log id in the state machine. LastApplied, @@ -34,7 +34,7 @@ pub enum StateMachineMetaKey { /// The last membership config LastMembership, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub enum StateMachineMetaValue { LogId(LogId), Bool(bool), diff --git a/common/meta/types/src/app_error.rs b/common/meta/types/src/app_error.rs index e0a0d23e9e1d..df9dc3859a56 100644 --- a/common/meta/types/src/app_error.rs +++ b/common/meta/types/src/app_error.rs @@ -27,7 +27,7 @@ pub trait AppErrorMessage: Display { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("DatabaseAlreadyExists: `{db_name}` while `{context}`")] pub struct DatabaseAlreadyExists { db_name: String, @@ -43,7 +43,7 @@ impl DatabaseAlreadyExists { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("CreateDatabaseWithDropTime: `{db_name}` with drop_on")] pub struct CreateDatabaseWithDropTime { db_name: String, @@ -57,7 +57,7 @@ impl CreateDatabaseWithDropTime { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("DropDbWithDropTime: drop {db_name} with drop_on time")] pub struct DropDbWithDropTime { db_name: String, @@ -71,7 +71,7 @@ impl DropDbWithDropTime { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("UndropDbWithNoDropTime: undrop {db_name} with no drop_on time")] pub struct UndropDbWithNoDropTime { db_name: String, @@ -85,7 +85,7 @@ impl UndropDbWithNoDropTime { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("UndropDbHasNoHistory: undrop {db_name} has no db id history")] pub struct UndropDbHasNoHistory { db_name: String, @@ -99,7 +99,7 @@ impl UndropDbHasNoHistory { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("TableAlreadyExists: {table_name} while {context}")] pub struct TableAlreadyExists { table_name: String, @@ -115,7 +115,7 @@ impl TableAlreadyExists { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("CreateTableWithDropTime: create {table_name} with drop time")] pub struct CreateTableWithDropTime { table_name: String, @@ -129,7 +129,7 @@ impl CreateTableWithDropTime { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("UndropTableAlreadyExists: undrop {table_name} already exists")] pub struct UndropTableAlreadyExists { table_name: String, @@ -143,7 +143,7 @@ impl UndropTableAlreadyExists { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("UndropTableWithNoDropTime: undrop {table_name} with no drop_on time")] pub struct UndropTableWithNoDropTime { table_name: String, @@ -157,7 +157,7 @@ impl UndropTableWithNoDropTime { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("DropTableWithDropTime: drop {table_name} with drop_on time")] pub struct DropTableWithDropTime { table_name: String, @@ -171,7 +171,7 @@ impl DropTableWithDropTime { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("UndropTableHasNoHistory: undrop {table_name} has no table id history")] pub struct UndropTableHasNoHistory { table_name: String, @@ -185,7 +185,7 @@ impl UndropTableHasNoHistory { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("TableVersionMismatched: {table_id} expect `{expect}` but `{curr}` while `{context}`")] pub struct TableVersionMismatched { table_id: u64, @@ -205,7 +205,7 @@ impl TableVersionMismatched { } } -#[derive(thiserror::Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(thiserror::Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[error("UnknownDatabase: `{db_name}` while `{context}`")] pub struct UnknownDatabase { db_name: String, @@ -221,7 +221,7 @@ impl UnknownDatabase { } } -#[derive(thiserror::Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(thiserror::Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[error("UnknownDatabaseId: `{db_id}` while `{context}`")] pub struct UnknownDatabaseId { db_id: u64, @@ -234,7 +234,7 @@ impl UnknownDatabaseId { } } -#[derive(thiserror::Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(thiserror::Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[error("UnknownTable: `{table_name}` while `{context}`")] pub struct UnknownTable { table_name: String, @@ -250,7 +250,7 @@ impl UnknownTable { } } -#[derive(thiserror::Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(thiserror::Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[error("UnknownTableId: `{table_id}` while `{context}`")] pub struct UnknownTableId { table_id: u64, @@ -266,7 +266,7 @@ impl UnknownTableId { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("ShareAlreadyExists: {share_name} while {context}")] pub struct ShareAlreadyExists { share_name: String, @@ -282,7 +282,7 @@ impl ShareAlreadyExists { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("UnknownShare: {share_name} while {context}")] pub struct UnknownShare { share_name: String, @@ -298,7 +298,7 @@ impl UnknownShare { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("UnknownShareID: {share_id} while {context}")] pub struct UnknownShareId { share_id: u64, @@ -314,7 +314,7 @@ impl UnknownShareId { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("TxnRetryMaxTimes: Txn {op} has retry {max_retry} times, abort.")] pub struct TxnRetryMaxTimes { op: String, @@ -330,7 +330,7 @@ impl TxnRetryMaxTimes { } } -#[derive(thiserror::Error, serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq)] +#[derive(thiserror::Error, serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] pub enum AppError { #[error(transparent)] TableVersionMismatched(#[from] TableVersionMismatched), diff --git a/common/meta/types/src/applied_state.rs b/common/meta/types/src/applied_state.rs index 6619e8835ad1..dd03808ff2d0 100644 --- a/common/meta/types/src/applied_state.rs +++ b/common/meta/types/src/applied_state.rs @@ -28,7 +28,7 @@ use crate::TxnReply; /// Normally it includes two fields: the state before applying and the state after applying the log. #[allow(clippy::large_enum_variant)] #[derive( - Serialize, Deserialize, Debug, Clone, PartialEq, derive_more::From, derive_more::TryInto, + Serialize, Deserialize, Debug, Clone, PartialEq, Eq, derive_more::From, derive_more::TryInto, )] pub enum AppliedState { Seq { diff --git a/common/meta/types/src/change.rs b/common/meta/types/src/change.rs index 9b56c95a76df..8317dcdba99c 100644 --- a/common/meta/types/src/change.rs +++ b/common/meta/types/src/change.rs @@ -29,7 +29,7 @@ pub struct AddResult { } /// `Change` describes a state change, including the states before and after a change. -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, derive_more::From)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, derive_more::From)] pub struct Change where ID: Clone + PartialEq, diff --git a/common/meta/types/src/cluster.rs b/common/meta/types/src/cluster.rs index e3892da0239f..b2b5ce6805dc 100644 --- a/common/meta/types/src/cluster.rs +++ b/common/meta/types/src/cluster.rs @@ -34,7 +34,7 @@ pub struct Slot { pub node_ids: Vec, } -#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq)] pub struct Node { pub name: String, pub endpoint: Endpoint, diff --git a/common/meta/types/src/cmd.rs b/common/meta/types/src/cmd.rs index 80635ed6e213..79eecd41e6c6 100644 --- a/common/meta/types/src/cmd.rs +++ b/common/meta/types/src/cmd.rs @@ -26,7 +26,7 @@ use crate::TxnRequest; /// A Cmd describes what a user want to do to raft state machine /// and is the essential part of a raft log. -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[allow(clippy::large_enum_variant)] pub enum Cmd { /// Increment the sequence number generator specified by `key` and returns the new value. diff --git a/common/meta/types/src/config.rs b/common/meta/types/src/config.rs index c5477ad43520..afbd3ce57b6e 100644 --- a/common/meta/types/src/config.rs +++ b/common/meta/types/src/config.rs @@ -20,7 +20,7 @@ pub static DATABEND_COMMIT_VERSION: Lazy = Lazy::new(|| { let rustc_semver = option_env!("VERGEN_RUSTC_SEMVER"); let timestamp = option_env!("VERGEN_BUILD_TIMESTAMP"); - let ver = match (build_semver, git_sha, rustc_semver, timestamp) { + match (build_semver, git_sha, rustc_semver, timestamp) { #[cfg(not(feature = "simd"))] (Some(v1), Some(v2), Some(v3), Some(v4)) => format!("{}-{}({}-{})", v1, v2, v3, v4), #[cfg(feature = "simd")] @@ -28,6 +28,5 @@ pub static DATABEND_COMMIT_VERSION: Lazy = Lazy::new(|| { format!("{}-{}-simd({}-{})", v1, v2, v3, v4) } _ => String::new(), - }; - ver + } }); diff --git a/common/meta/types/src/endpoint.rs b/common/meta/types/src/endpoint.rs index 3923a4123ee6..d294c76f0d82 100644 --- a/common/meta/types/src/endpoint.rs +++ b/common/meta/types/src/endpoint.rs @@ -17,7 +17,7 @@ use std::fmt; use serde::Deserialize; use serde::Serialize; -#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq)] pub struct Endpoint { pub addr: String, pub port: u32, diff --git a/common/meta/types/src/error_context.rs b/common/meta/types/src/error_context.rs index 68fb0f05458a..240ef7e9f632 100644 --- a/common/meta/types/src/error_context.rs +++ b/common/meta/types/src/error_context.rs @@ -17,7 +17,7 @@ use std::error::Error; use serde::Deserialize; use serde::Serialize; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] #[error("{err} while {context}")] pub struct ErrorWithContext { #[source] diff --git a/common/meta/types/src/errors.rs b/common/meta/types/src/errors.rs index 98692f919cb5..9b0b2b90936d 100644 --- a/common/meta/types/src/errors.rs +++ b/common/meta/types/src/errors.rs @@ -17,7 +17,7 @@ use serde::Serialize; use crate::MatchSeq; -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub enum ConflictSeq { NotMatch { want: MatchSeq, got: u64 }, } diff --git a/common/meta/types/src/kv_message.rs b/common/meta/types/src/kv_message.rs index 40ff5a5f207f..375e054dab0e 100644 --- a/common/meta/types/src/kv_message.rs +++ b/common/meta/types/src/kv_message.rs @@ -18,17 +18,17 @@ use crate::MatchSeq; use crate::Operation; use crate::SeqV; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct GetKVReq { pub key: String, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct MGetKVReq { pub keys: Vec, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ListKVReq { pub prefix: String, } @@ -38,7 +38,7 @@ pub type GetKVReply = Option>>; pub type MGetKVReply = Vec>>>; pub type ListKVReply = Vec<(String, SeqV>)>; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UpsertKVReq { pub key: String, pub seq: MatchSeq, diff --git a/common/meta/types/src/log_entry.rs b/common/meta/types/src/log_entry.rs index 215ed4e36aa2..5f78ddfa97d1 100644 --- a/common/meta/types/src/log_entry.rs +++ b/common/meta/types/src/log_entry.rs @@ -24,7 +24,7 @@ use crate::RaftTxId; /// The client and the serial together provides external consistency: /// If a client failed to recv the response, it re-send another RaftRequest with the same /// "client" and "serial", thus the raft engine is able to distinguish if a request is duplicated. -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct LogEntry { /// When not None, it is used to filter out duplicated logs, which are caused by retries by client. pub txid: Option, diff --git a/common/meta/types/src/message.rs b/common/meta/types/src/message.rs index a17a42c4030c..d0ab406389ab 100644 --- a/common/meta/types/src/message.rs +++ b/common/meta/types/src/message.rs @@ -35,7 +35,7 @@ use crate::NodeId; use crate::TxnOpResponse; use crate::TxnReply; -#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub enum RetryableError { /// Trying to write to a non-leader returns the latest leader the raft node knows, /// to indicate the client to retry. @@ -43,20 +43,20 @@ pub enum RetryableError { ForwardToLeader { leader: NodeId }, } -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct JoinRequest { pub node_id: NodeId, pub endpoint: Endpoint, pub grpc_api_addr: String, } -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct LeaveRequest { pub node_id: NodeId, } #[derive( - Serialize, Deserialize, Debug, Clone, PartialEq, derive_more::From, derive_more::TryInto, + Serialize, Deserialize, Debug, Clone, PartialEq, Eq, derive_more::From, derive_more::TryInto, )] pub enum ForwardRequestBody { Ping, @@ -72,7 +72,7 @@ pub enum ForwardRequestBody { } /// A request that is forwarded from one raft node to another -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct ForwardRequest { /// Forward the request to leader if the node received this request is not leader. pub forward_to_leader: u64, @@ -86,7 +86,7 @@ impl ForwardRequest { } } -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, derive_more::TryInto)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, derive_more::TryInto)] #[allow(clippy::large_enum_variant)] pub enum ForwardResponse { #[try_into(ignore)] diff --git a/common/meta/types/src/meta_errors.rs b/common/meta/types/src/meta_errors.rs index 02cbfc27236c..7d2ac26d8b0d 100644 --- a/common/meta/types/src/meta_errors.rs +++ b/common/meta/types/src/meta_errors.rs @@ -24,7 +24,7 @@ use crate::MetaResultError; use crate::MetaStorageError; /// Top level error MetaNode would return. -#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub enum MetaError { #[error(transparent)] MetaNetworkError(#[from] MetaNetworkError), @@ -81,6 +81,6 @@ pub enum MetaError { pub type MetaResult = Result; -#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[error("InvalidMembership")] pub struct InvalidMembership {} diff --git a/common/meta/types/src/meta_network_errors.rs b/common/meta/types/src/meta_network_errors.rs index 4c5bd256d734..0333218a7247 100644 --- a/common/meta/types/src/meta_network_errors.rs +++ b/common/meta/types/src/meta_network_errors.rs @@ -19,7 +19,7 @@ use serde::Serialize; use thiserror::Error; // represent network related errors -#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub enum MetaNetworkError { #[error(transparent)] ConnectionError(#[from] ConnectionError), @@ -65,7 +65,7 @@ impl From for ErrorCode { pub type MetaNetworkResult = std::result::Result; -#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[error("ConnectionError: {msg} source: {source}")] pub struct ConnectionError { msg: String, @@ -82,7 +82,7 @@ impl ConnectionError { } } -#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[error("InvalidArgument: {msg} source: {source}")] pub struct InvalidArgument { msg: String, diff --git a/common/meta/types/src/meta_raft_errors.rs b/common/meta/types/src/meta_raft_errors.rs index fab0a29d0ea9..a58e72437341 100644 --- a/common/meta/types/src/meta_raft_errors.rs +++ b/common/meta/types/src/meta_raft_errors.rs @@ -22,7 +22,7 @@ use thiserror::Error; pub type ForwardToLeader = openraft::error::ForwardToLeader; // represent raft related errors -#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub enum MetaRaftError { #[error(transparent)] ForwardToLeader(#[from] ForwardToLeader), @@ -46,7 +46,7 @@ pub enum MetaRaftError { RequestNotForwardToLeaderError(String), } -#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Error, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub enum RetryableError { /// Trying to write to a non-leader returns the latest leader the raft node knows, /// to indicate the client to retry. diff --git a/common/meta/types/src/meta_result_error.rs b/common/meta/types/src/meta_result_error.rs index 87964b504c43..ac1d4bd4dccc 100644 --- a/common/meta/types/src/meta_result_error.rs +++ b/common/meta/types/src/meta_result_error.rs @@ -17,7 +17,7 @@ use serde::Deserialize; use serde::Serialize; /// Errors about an invalid meta operation result -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] pub enum MetaResultError { #[error("The result of an add operation is invalid: before: {prev}, after: {result}")] InvalidAddResult { prev: String, result: String }, diff --git a/common/meta/types/src/meta_storage_errors.rs b/common/meta/types/src/meta_storage_errors.rs index cbb154220166..552c4c41d6b6 100644 --- a/common/meta/types/src/meta_storage_errors.rs +++ b/common/meta/types/src/meta_storage_errors.rs @@ -20,7 +20,7 @@ use sled::transaction::UnabortableTransactionError; use crate::error_context::ErrorWithContext; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, thiserror::Error)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, thiserror::Error)] pub enum MetaStorageError { // type to represent bytes format errors #[error("{0}")] diff --git a/common/meta/types/src/operation.rs b/common/meta/types/src/operation.rs index e89a52b55159..8f1330e09146 100644 --- a/common/meta/types/src/operation.rs +++ b/common/meta/types/src/operation.rs @@ -20,7 +20,7 @@ use std::fmt::Formatter; pub type MetaId = u64; /// An operation that updates a field, delete it, or leave it as is. -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub enum Operation { Update(T), Delete, @@ -48,7 +48,7 @@ where for<'x> T: serde::Serialize + serde::Deserialize<'x> + Debug + Clone } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct GCDroppedDataReq { pub tenant: String, // gc at least dropped tables, 0 means donot gc table @@ -57,7 +57,7 @@ pub struct GCDroppedDataReq { pub db_at_least: u32, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct GCDroppedDataReply { pub gc_table_count: u32, pub gc_db_count: u32, diff --git a/common/meta/types/src/raft_txid.rs b/common/meta/types/src/raft_txid.rs index 916a65894f88..d556ce9799b9 100644 --- a/common/meta/types/src/raft_txid.rs +++ b/common/meta/types/src/raft_txid.rs @@ -20,7 +20,7 @@ use serde::Serialize; /// RaftTxId is the essential info to identify an write operation to raft. /// Logs with the same RaftTxId are considered the same and only the first of them will be applied. -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct RaftTxId { /// The ID of the client which has sent the request. pub client: String, diff --git a/common/meta/types/src/share.rs b/common/meta/types/src/share.rs index 0adb7d1b9326..88a7fb1502e1 100644 --- a/common/meta/types/src/share.rs +++ b/common/meta/types/src/share.rs @@ -41,7 +41,7 @@ pub struct ShareMeta { pub tables: Vec, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateShareReq { pub if_not_exists: bool, pub tenant: String, @@ -63,7 +63,7 @@ pub struct CreateShareReply { pub share_id: u64, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropShareReq { pub if_exists: bool, pub tenant: String, @@ -76,10 +76,10 @@ impl Display for DropShareReq { } } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropShareReply {} -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct GetShareReq { pub tenant: String, pub share_name: String, diff --git a/common/planners/src/plan_call.rs b/common/planners/src/plan_call.rs index cd5ae577e4cd..5c064ecd94d3 100644 --- a/common/planners/src/plan_call.rs +++ b/common/planners/src/plan_call.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CallPlan { pub name: String, pub args: Vec, diff --git a/common/planners/src/plan_copy.rs b/common/planners/src/plan_copy.rs index a8cbdf38f1b2..b21cf97760ec 100644 --- a/common/planners/src/plan_copy.rs +++ b/common/planners/src/plan_copy.rs @@ -23,7 +23,7 @@ use crate::PlanNode; use crate::ReadDataSourcePlan; use crate::StageTableInfo; -#[derive(serde::Serialize, serde::Deserialize, PartialEq, Clone, Debug)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Debug)] pub enum ValidationMode { None, ReturnNRows(u64), diff --git a/common/planners/src/plan_database_create.rs b/common/planners/src/plan_database_create.rs index aa5ca862de0b..24137c1ce839 100644 --- a/common/planners/src/plan_database_create.rs +++ b/common/planners/src/plan_database_create.rs @@ -20,7 +20,7 @@ use common_meta_app::schema::CreateDatabaseReq; use common_meta_app::schema::DatabaseMeta; use common_meta_app::schema::DatabaseNameIdent; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateDatabasePlan { pub if_not_exists: bool, pub tenant: String, diff --git a/common/planners/src/plan_database_drop.rs b/common/planners/src/plan_database_drop.rs index bca810b379f8..4356a714d486 100644 --- a/common/planners/src/plan_database_drop.rs +++ b/common/planners/src/plan_database_drop.rs @@ -19,7 +19,7 @@ use common_datavalues::DataSchemaRef; use common_meta_app::schema::DatabaseNameIdent; use common_meta_app::schema::DropDatabaseReq; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropDatabasePlan { pub if_exists: bool, pub tenant: String, diff --git a/common/planners/src/plan_database_rename.rs b/common/planners/src/plan_database_rename.rs index 67fb98f198f8..961f5f16d7b6 100644 --- a/common/planners/src/plan_database_rename.rs +++ b/common/planners/src/plan_database_rename.rs @@ -17,13 +17,13 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RenameDatabasePlan { pub tenant: String, pub entities: Vec, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RenameDatabaseEntity { pub if_exists: bool, pub catalog: String, diff --git a/common/planners/src/plan_database_show_create.rs b/common/planners/src/plan_database_show_create.rs index 0b74bf00dd82..9d336698a8a0 100644 --- a/common/planners/src/plan_database_show_create.rs +++ b/common/planners/src/plan_database_show_create.rs @@ -14,7 +14,7 @@ use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowCreateDatabasePlan { pub catalog: String, pub database: String, diff --git a/common/planners/src/plan_database_undrop.rs b/common/planners/src/plan_database_undrop.rs index 727048cfed5c..e6219c9f23c3 100644 --- a/common/planners/src/plan_database_undrop.rs +++ b/common/planners/src/plan_database_undrop.rs @@ -19,7 +19,7 @@ use common_datavalues::DataSchemaRef; use common_meta_app::schema::DatabaseNameIdent; use common_meta_app::schema::UndropDatabaseReq; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UndropDatabasePlan { pub tenant: String, pub catalog: String, diff --git a/common/planners/src/plan_empty.rs b/common/planners/src/plan_empty.rs index fa501b8bb68f..1bbd1bb460ee 100644 --- a/common/planners/src/plan_empty.rs +++ b/common/planners/src/plan_empty.rs @@ -15,7 +15,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct EmptyPlan { pub schema: DataSchemaRef, pub is_cluster: bool, diff --git a/common/planners/src/plan_explain.rs b/common/planners/src/plan_explain.rs index 90421b2a7251..53526d0a3c1b 100644 --- a/common/planners/src/plan_explain.rs +++ b/common/planners/src/plan_explain.rs @@ -18,7 +18,7 @@ use common_datavalues::prelude::*; use crate::PlanNode; -#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, Debug, PartialEq, Eq)] pub enum ExplainType { Syntax, Graph, diff --git a/common/planners/src/plan_expression_monotonicity.rs b/common/planners/src/plan_expression_monotonicity.rs index 99adf2343dbf..52eea57256ba 100644 --- a/common/planners/src/plan_expression_monotonicity.rs +++ b/common/planners/src/plan_expression_monotonicity.rs @@ -225,7 +225,7 @@ impl ExpressionVisitor for ExpressionMonotonicityVisitor { fn post_visit(mut self, expr: &Expression) -> Result { match expr { Expression::Column(s) => { - let (left, right) = self.variables.get(&*s).ok_or_else(|| { + let (left, right) = self.variables.get(s).ok_or_else(|| { ErrorCode::BadArguments(format!("Cannot find the column name '{:?}'", *s)) })?; diff --git a/common/planners/src/plan_expression_validator.rs b/common/planners/src/plan_expression_validator.rs index 213d2fde0204..cbfd6c5dd97a 100644 --- a/common/planners/src/plan_expression_validator.rs +++ b/common/planners/src/plan_expression_validator.rs @@ -63,24 +63,24 @@ pub fn validate_function_arg( ) -> Result<()> { match variadic_arguments { Some((start, end)) => { - return if args_len < start || args_len > end { + if args_len < start || args_len > end { Err(ErrorCode::NumberArgumentsNotMatch(format!( "Function `{}` expect to have [{}, {}] arguments, but got {}", name, start, end, args_len ))) } else { Ok(()) - }; + } } None => { - return if num_arguments != args_len { + if num_arguments != args_len { Err(ErrorCode::NumberArgumentsNotMatch(format!( "Function `{}` expect to have {} arguments, but got {}", name, num_arguments, args_len ))) } else { Ok(()) - }; + } } } } diff --git a/common/planners/src/plan_kill.rs b/common/planners/src/plan_kill.rs index 8ac2f8c98abe..98dddbbb7e44 100644 --- a/common/planners/src/plan_kill.rs +++ b/common/planners/src/plan_kill.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct KillPlan { pub id: String, pub kill_connection: bool, diff --git a/common/planners/src/plan_list.rs b/common/planners/src/plan_list.rs index 006a450f4c7a..0eb0b3f87b6e 100644 --- a/common/planners/src/plan_list.rs +++ b/common/planners/src/plan_list.rs @@ -23,7 +23,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_meta_types::UserStageInfo; -#[derive(serde::Serialize, serde::Deserialize, PartialEq, Clone)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone)] pub struct ListPlan { pub stage: UserStageInfo, pub path: String, diff --git a/common/planners/src/plan_node_stage.rs b/common/planners/src/plan_node_stage.rs index 6fba6d22949a..9709307ad384 100644 --- a/common/planners/src/plan_node_stage.rs +++ b/common/planners/src/plan_node_stage.rs @@ -19,7 +19,7 @@ use common_datavalues::DataSchemaRef; use crate::Expression; use crate::PlanNode; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub enum StageKind { Normal, Expansive, diff --git a/common/planners/src/plan_node_stage_table.rs b/common/planners/src/plan_node_stage_table.rs index 957fe02f8aee..3d6826747733 100644 --- a/common/planners/src/plan_node_stage_table.rs +++ b/common/planners/src/plan_node_stage_table.rs @@ -18,7 +18,7 @@ use std::fmt::Formatter; use common_datavalues::DataSchemaRef; use common_meta_types::UserStageInfo; -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct StageTableInfo { pub schema: DataSchemaRef, pub stage_info: UserStageInfo, diff --git a/common/planners/src/plan_privilege_grant.rs b/common/planners/src/plan_privilege_grant.rs index 7ef0127db333..e43f58b503f5 100644 --- a/common/planners/src/plan_privilege_grant.rs +++ b/common/planners/src/plan_privilege_grant.rs @@ -20,7 +20,7 @@ use common_meta_types::GrantObject; use common_meta_types::PrincipalIdentity; use common_meta_types::UserPrivilegeSet; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct GrantPrivilegePlan { pub principal: PrincipalIdentity, pub priv_types: UserPrivilegeSet, diff --git a/common/planners/src/plan_privilege_revoke.rs b/common/planners/src/plan_privilege_revoke.rs index 39c3e6957431..551824e11ef4 100644 --- a/common/planners/src/plan_privilege_revoke.rs +++ b/common/planners/src/plan_privilege_revoke.rs @@ -20,7 +20,7 @@ use common_meta_types::GrantObject; use common_meta_types::PrincipalIdentity; use common_meta_types::UserPrivilegeSet; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RevokePrivilegePlan { pub principal: PrincipalIdentity, pub priv_types: UserPrivilegeSet, diff --git a/common/planners/src/plan_read_datasource.rs b/common/planners/src/plan_read_datasource.rs index a1c388222422..6d175a74573d 100644 --- a/common/planners/src/plan_read_datasource.rs +++ b/common/planners/src/plan_read_datasource.rs @@ -26,7 +26,7 @@ use crate::Partitions; use crate::StageTableInfo; use crate::Statistics; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub enum SourceInfo { // Normal table source, `fuse/system`. TableSource(TableInfo), diff --git a/common/planners/src/plan_remote.rs b/common/planners/src/plan_remote.rs index 50390356e39b..76bb6af62fcd 100644 --- a/common/planners/src/plan_remote.rs +++ b/common/planners/src/plan_remote.rs @@ -14,7 +14,7 @@ use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct V1RemotePlan { pub schema: DataSchemaRef, pub query_id: String, @@ -23,14 +23,14 @@ pub struct V1RemotePlan { pub fetch_nodes: Vec, } -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct V2RemotePlan { schema: DataSchemaRef, pub receive_query_id: String, pub receive_fragment_id: usize, } -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub enum RemotePlan { V1(V1RemotePlan), V2(V2RemotePlan), diff --git a/common/planners/src/plan_role_create.rs b/common/planners/src/plan_role_create.rs index 13284f4aa1b1..4fc3593e2400 100644 --- a/common/planners/src/plan_role_create.rs +++ b/common/planners/src/plan_role_create.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateRolePlan { pub if_not_exists: bool, pub role_name: String, diff --git a/common/planners/src/plan_role_drop.rs b/common/planners/src/plan_role_drop.rs index 88f2a4592593..29416abfa50c 100644 --- a/common/planners/src/plan_role_drop.rs +++ b/common/planners/src/plan_role_drop.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropRolePlan { pub if_exists: bool, pub role_name: String, diff --git a/common/planners/src/plan_role_grant.rs b/common/planners/src/plan_role_grant.rs index 13ab94e38d48..37b3a92273f5 100644 --- a/common/planners/src/plan_role_grant.rs +++ b/common/planners/src/plan_role_grant.rs @@ -18,7 +18,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_meta_types::PrincipalIdentity; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct GrantRolePlan { pub principal: PrincipalIdentity, pub role: String, diff --git a/common/planners/src/plan_role_revoke.rs b/common/planners/src/plan_role_revoke.rs index d47887bc90be..d49c70199735 100644 --- a/common/planners/src/plan_role_revoke.rs +++ b/common/planners/src/plan_role_revoke.rs @@ -18,7 +18,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_meta_types::PrincipalIdentity; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RevokeRolePlan { pub principal: PrincipalIdentity, pub role: String, diff --git a/common/planners/src/plan_setting.rs b/common/planners/src/plan_setting.rs index d96f1a4a2f3e..16ae0a65fa74 100644 --- a/common/planners/src/plan_setting.rs +++ b/common/planners/src/plan_setting.rs @@ -17,13 +17,13 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct VarValue { pub variable: String, pub value: String, } -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct SettingPlan { pub vars: Vec, } diff --git a/common/planners/src/plan_show.rs b/common/planners/src/plan_show.rs index 1bb968d1ae90..eb97de9699b0 100644 --- a/common/planners/src/plan_show.rs +++ b/common/planners/src/plan_show.rs @@ -29,7 +29,7 @@ use crate::ShowSettingsPlan; use crate::ShowTablesPlan; use crate::ShowUsersPlan; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub enum PlanShowKind { All, @@ -40,7 +40,7 @@ pub enum PlanShowKind { Where(String), } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub enum ShowPlan { ShowDatabases(ShowDatabasesPlan), ShowTables(ShowTablesPlan), diff --git a/common/planners/src/plan_show_databases.rs b/common/planners/src/plan_show_databases.rs index aa327150f47c..f0d163e5d31d 100644 --- a/common/planners/src/plan_show_databases.rs +++ b/common/planners/src/plan_show_databases.rs @@ -14,7 +14,7 @@ use crate::PlanShowKind; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowDatabasesPlan { pub kind: PlanShowKind, } diff --git a/common/planners/src/plan_show_engines.rs b/common/planners/src/plan_show_engines.rs index cbbf87abbea5..31253c3446e5 100644 --- a/common/planners/src/plan_show_engines.rs +++ b/common/planners/src/plan_show_engines.rs @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowEnginesPlan {} diff --git a/common/planners/src/plan_show_functions.rs b/common/planners/src/plan_show_functions.rs index 9828a81dd1d0..5591627d68fd 100644 --- a/common/planners/src/plan_show_functions.rs +++ b/common/planners/src/plan_show_functions.rs @@ -14,7 +14,7 @@ use crate::PlanShowKind; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowFunctionsPlan { pub kind: PlanShowKind, } diff --git a/common/planners/src/plan_show_grants.rs b/common/planners/src/plan_show_grants.rs index 1bdbcc124697..2ec043aef251 100644 --- a/common/planners/src/plan_show_grants.rs +++ b/common/planners/src/plan_show_grants.rs @@ -14,7 +14,7 @@ use common_meta_types::PrincipalIdentity; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowGrantsPlan { pub principal: Option, } diff --git a/common/planners/src/plan_show_metrics.rs b/common/planners/src/plan_show_metrics.rs index 5679189c46a1..70d6ea8c6558 100644 --- a/common/planners/src/plan_show_metrics.rs +++ b/common/planners/src/plan_show_metrics.rs @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowMetricsPlan {} diff --git a/common/planners/src/plan_show_processlist.rs b/common/planners/src/plan_show_processlist.rs index 174b80d7e379..133a50e8d4c1 100644 --- a/common/planners/src/plan_show_processlist.rs +++ b/common/planners/src/plan_show_processlist.rs @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowProcessListsPlan {} diff --git a/common/planners/src/plan_show_roles.rs b/common/planners/src/plan_show_roles.rs index 81f2d284e1d0..635743b1349e 100644 --- a/common/planners/src/plan_show_roles.rs +++ b/common/planners/src/plan_show_roles.rs @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(serde::Serialize, serde::Deserialize, PartialEq, Clone, Debug)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Debug)] pub struct ShowRolesPlan {} diff --git a/common/planners/src/plan_show_settings.rs b/common/planners/src/plan_show_settings.rs index 1063a4202f38..db48009bd477 100644 --- a/common/planners/src/plan_show_settings.rs +++ b/common/planners/src/plan_show_settings.rs @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowSettingsPlan {} diff --git a/common/planners/src/plan_show_tables.rs b/common/planners/src/plan_show_tables.rs index c8b10e4dfa6d..2a5dce7f8f6a 100644 --- a/common/planners/src/plan_show_tables.rs +++ b/common/planners/src/plan_show_tables.rs @@ -14,7 +14,7 @@ use crate::PlanShowKind; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowTablesPlan { pub kind: PlanShowKind, pub showfull: bool, diff --git a/common/planners/src/plan_show_tables_status.rs b/common/planners/src/plan_show_tables_status.rs index 16e7ca481c9e..f4dbaf2ec1fd 100644 --- a/common/planners/src/plan_show_tables_status.rs +++ b/common/planners/src/plan_show_tables_status.rs @@ -14,7 +14,7 @@ use crate::PlanShowKind; -#[derive(serde::Serialize, serde::Deserialize, PartialEq, Clone, Debug)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Debug)] pub struct ShowTablesStatusPlan { pub kind: PlanShowKind, // show tables from db1 [or in db1] diff --git a/common/planners/src/plan_show_users.rs b/common/planners/src/plan_show_users.rs index 65fea7fee648..2403fd901458 100644 --- a/common/planners/src/plan_show_users.rs +++ b/common/planners/src/plan_show_users.rs @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowUsersPlan {} diff --git a/common/planners/src/plan_table_alter_cluster_key.rs b/common/planners/src/plan_table_alter_cluster_key.rs index 72238647c7d2..2bd7faf770ba 100644 --- a/common/planners/src/plan_table_alter_cluster_key.rs +++ b/common/planners/src/plan_table_alter_cluster_key.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct AlterTableClusterKeyPlan { pub tenant: String, pub catalog: String, diff --git a/common/planners/src/plan_table_describe.rs b/common/planners/src/plan_table_describe.rs index 18ea03cfa286..b7859252d4e8 100644 --- a/common/planners/src/plan_table_describe.rs +++ b/common/planners/src/plan_table_describe.rs @@ -14,7 +14,7 @@ use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DescribeTablePlan { pub catalog: String, pub database: String, diff --git a/common/planners/src/plan_table_drop.rs b/common/planners/src/plan_table_drop.rs index b7b7404e3458..d4725077014e 100644 --- a/common/planners/src/plan_table_drop.rs +++ b/common/planners/src/plan_table_drop.rs @@ -19,7 +19,7 @@ use common_datavalues::DataSchemaRef; use common_meta_app::schema::DropTableReq; use common_meta_app::schema::TableNameIdent; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropTablePlan { pub if_exists: bool, pub tenant: String, diff --git a/common/planners/src/plan_table_drop_cluster_key.rs b/common/planners/src/plan_table_drop_cluster_key.rs index 9ed71ce15d12..bacee31335df 100644 --- a/common/planners/src/plan_table_drop_cluster_key.rs +++ b/common/planners/src/plan_table_drop_cluster_key.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropTableClusterKeyPlan { pub tenant: String, pub catalog: String, diff --git a/common/planners/src/plan_table_exists.rs b/common/planners/src/plan_table_exists.rs index 0a21943f89c6..51bc1810da01 100644 --- a/common/planners/src/plan_table_exists.rs +++ b/common/planners/src/plan_table_exists.rs @@ -19,7 +19,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_datavalues::ToDataType; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ExistsTablePlan { pub catalog: String, pub database: String, diff --git a/common/planners/src/plan_table_optimize.rs b/common/planners/src/plan_table_optimize.rs index 50dffc2e338a..4bc68d9f0dcc 100644 --- a/common/planners/src/plan_table_optimize.rs +++ b/common/planners/src/plan_table_optimize.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct OptimizeTablePlan { pub catalog: String, pub database: String, @@ -31,7 +31,7 @@ impl OptimizeTablePlan { } } -#[derive(serde::Serialize, serde::Deserialize, Copy, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Copy, Clone, Debug, PartialEq, Eq)] pub enum OptimizeTableAction { All, Purge, diff --git a/common/planners/src/plan_table_rename.rs b/common/planners/src/plan_table_rename.rs index 852f014fb18d..ea1448156363 100644 --- a/common/planners/src/plan_table_rename.rs +++ b/common/planners/src/plan_table_rename.rs @@ -17,13 +17,13 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RenameTablePlan { pub tenant: String, pub entities: Vec, } -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RenameTableEntity { pub if_exists: bool, pub catalog: String, diff --git a/common/planners/src/plan_table_show_create.rs b/common/planners/src/plan_table_show_create.rs index bb1e2b161196..ac27220892cf 100644 --- a/common/planners/src/plan_table_show_create.rs +++ b/common/planners/src/plan_table_show_create.rs @@ -14,7 +14,7 @@ use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct ShowCreateTablePlan { /// The catalog name pub catalog: String, diff --git a/common/planners/src/plan_table_truncate.rs b/common/planners/src/plan_table_truncate.rs index 28d15edb6ca2..6d257402d919 100644 --- a/common/planners/src/plan_table_truncate.rs +++ b/common/planners/src/plan_table_truncate.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct TruncateTablePlan { pub catalog: String, pub database: String, diff --git a/common/planners/src/plan_table_undrop.rs b/common/planners/src/plan_table_undrop.rs index a6acebed7bd0..7c469339ba3d 100644 --- a/common/planners/src/plan_table_undrop.rs +++ b/common/planners/src/plan_table_undrop.rs @@ -19,7 +19,7 @@ use common_datavalues::DataSchemaRef; use common_meta_app::schema::TableNameIdent; use common_meta_app::schema::UndropTableReq; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UndropTablePlan { pub tenant: String, pub catalog: String, diff --git a/common/planners/src/plan_use_database.rs b/common/planners/src/plan_use_database.rs index acd03a5dceab..74ce2b287572 100644 --- a/common/planners/src/plan_use_database.rs +++ b/common/planners/src/plan_use_database.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct UseDatabasePlan { pub database: String, } diff --git a/common/planners/src/plan_user_alter.rs b/common/planners/src/plan_user_alter.rs index 02b428da2fd9..779bfa116f28 100644 --- a/common/planners/src/plan_user_alter.rs +++ b/common/planners/src/plan_user_alter.rs @@ -20,7 +20,7 @@ use common_meta_types::AuthInfo; use common_meta_types::UserIdentity; use common_meta_types::UserOption; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct AlterUserPlan { pub user: UserIdentity, // None means no change to make diff --git a/common/planners/src/plan_user_create.rs b/common/planners/src/plan_user_create.rs index 4cbf4608d91e..f696b46d0cf4 100644 --- a/common/planners/src/plan_user_create.rs +++ b/common/planners/src/plan_user_create.rs @@ -20,7 +20,7 @@ use common_meta_types::AuthInfo; use common_meta_types::UserIdentity; use common_meta_types::UserOption; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateUserPlan { pub user: UserIdentity, pub auth_info: AuthInfo, diff --git a/common/planners/src/plan_user_drop.rs b/common/planners/src/plan_user_drop.rs index 79fe63281e3e..6ec90c534061 100644 --- a/common/planners/src/plan_user_drop.rs +++ b/common/planners/src/plan_user_drop.rs @@ -18,7 +18,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_meta_types::UserIdentity; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropUserPlan { pub if_exists: bool, pub user: UserIdentity, diff --git a/common/planners/src/plan_user_stage_create.rs b/common/planners/src/plan_user_stage_create.rs index 1db05ef66a65..98551b889517 100644 --- a/common/planners/src/plan_user_stage_create.rs +++ b/common/planners/src/plan_user_stage_create.rs @@ -18,7 +18,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_meta_types::UserStageInfo; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateUserStagePlan { pub if_not_exists: bool, pub tenant: String, diff --git a/common/planners/src/plan_user_stage_describe.rs b/common/planners/src/plan_user_stage_describe.rs index 737fffd0d432..26d6ed5982c9 100644 --- a/common/planners/src/plan_user_stage_describe.rs +++ b/common/planners/src/plan_user_stage_describe.rs @@ -13,7 +13,7 @@ // limitations under the License. use common_datavalues::prelude::*; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DescribeUserStagePlan { pub name: String, } diff --git a/common/planners/src/plan_user_stage_drop.rs b/common/planners/src/plan_user_stage_drop.rs index d9c90cd3b8c6..343b9b5eb238 100644 --- a/common/planners/src/plan_user_stage_drop.rs +++ b/common/planners/src/plan_user_stage_drop.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropUserStagePlan { pub if_exists: bool, pub name: String, diff --git a/common/planners/src/plan_user_stage_remove.rs b/common/planners/src/plan_user_stage_remove.rs index 55a2bb396821..f632e0f04010 100644 --- a/common/planners/src/plan_user_stage_remove.rs +++ b/common/planners/src/plan_user_stage_remove.rs @@ -18,7 +18,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_meta_types::UserStageInfo; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RemoveUserStagePlan { pub stage: UserStageInfo, pub path: String, diff --git a/common/planners/src/plan_user_udf_alter.rs b/common/planners/src/plan_user_udf_alter.rs index ce71f009a004..6638fd8829f1 100644 --- a/common/planners/src/plan_user_udf_alter.rs +++ b/common/planners/src/plan_user_udf_alter.rs @@ -18,7 +18,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_meta_types::UserDefinedFunction; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct AlterUserUDFPlan { pub udf: UserDefinedFunction, } diff --git a/common/planners/src/plan_user_udf_create.rs b/common/planners/src/plan_user_udf_create.rs index 8864663ecf40..bcce8b4417a1 100644 --- a/common/planners/src/plan_user_udf_create.rs +++ b/common/planners/src/plan_user_udf_create.rs @@ -18,7 +18,7 @@ use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; use common_meta_types::UserDefinedFunction; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateUserUDFPlan { pub if_not_exists: bool, pub udf: UserDefinedFunction, diff --git a/common/planners/src/plan_user_udf_drop.rs b/common/planners/src/plan_user_udf_drop.rs index 76660c3737d9..814d611fd6d9 100644 --- a/common/planners/src/plan_user_udf_drop.rs +++ b/common/planners/src/plan_user_udf_drop.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropUserUDFPlan { pub if_exists: bool, pub name: String, diff --git a/common/planners/src/plan_view_alter.rs b/common/planners/src/plan_view_alter.rs index 9ad6f3442202..548045d3f17a 100644 --- a/common/planners/src/plan_view_alter.rs +++ b/common/planners/src/plan_view_alter.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct AlterViewPlan { pub tenant: String, pub catalog: String, diff --git a/common/planners/src/plan_view_create.rs b/common/planners/src/plan_view_create.rs index dca7964dc9a9..c2405b2a908b 100644 --- a/common/planners/src/plan_view_create.rs +++ b/common/planners/src/plan_view_create.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CreateViewPlan { pub if_not_exists: bool, pub tenant: String, diff --git a/common/planners/src/plan_view_drop.rs b/common/planners/src/plan_view_drop.rs index 2338153f24c1..a9b372469e38 100644 --- a/common/planners/src/plan_view_drop.rs +++ b/common/planners/src/plan_view_drop.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use common_datavalues::DataSchema; use common_datavalues::DataSchemaRef; -#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, PartialEq, Eq)] pub struct DropViewPlan { pub if_exists: bool, pub tenant: String, diff --git a/common/proto-conv/src/user_from_to_protobuf_impl.rs b/common/proto-conv/src/user_from_to_protobuf_impl.rs index e8203d791893..bbb318dff4b2 100644 --- a/common/proto-conv/src/user_from_to_protobuf_impl.rs +++ b/common/proto-conv/src/user_from_to_protobuf_impl.rs @@ -84,11 +84,9 @@ impl FromToProto for mt::UserOption { let flags = BitFlags::::from_bits(p.flags); match flags { Ok(flags) => Ok(mt::UserOption::new(flags)), - Err(e) => { - return Err(Incompatible { - reason: format!("UserOptionFlag error: {}", e), - }); - } + Err(e) => Err(Incompatible { + reason: format!("UserOptionFlag error: {}", e), + }), } } @@ -188,11 +186,9 @@ impl FromToProto for mt::GrantEntry { })?)?, privileges, )), - Err(e) => { - return Err(Incompatible { - reason: format!("UserPrivilegeType error: {}", e), - }); - } + Err(e) => Err(Incompatible { + reason: format!("UserPrivilegeType error: {}", e), + }), } } @@ -412,7 +408,7 @@ impl FromToProto for StorageParams { } fn to_pb(&self) -> Result { - match &*self { + match self { StorageParams::S3(_) => Ok(pb::user_stage_info::StageStorage { storage: Some(pb::user_stage_info::stage_storage::Storage::S3( self.to_pb()?, diff --git a/common/protos/src/lib.rs b/common/protos/src/lib.rs index b3498c5d4d84..f8e33b6d7396 100644 --- a/common/protos/src/lib.rs +++ b/common/protos/src/lib.rs @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +#[allow(clippy::derive_partial_eq_without_eq)] /// ProtoBuf generated files. pub mod pb { diff --git a/common/tracing/src/config.rs b/common/tracing/src/config.rs index 12e9c14a14a9..2608c5488d9f 100644 --- a/common/tracing/src/config.rs +++ b/common/tracing/src/config.rs @@ -13,7 +13,7 @@ // limitations under the License. /// Config for tracing. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Config { pub level: String, pub dir: String, diff --git a/metasrv/src/configs/inner.rs b/metasrv/src/configs/inner.rs index a4735bb790cd..e0400fdb6b7b 100644 --- a/metasrv/src/configs/inner.rs +++ b/metasrv/src/configs/inner.rs @@ -18,7 +18,7 @@ use common_meta_types::Node; use super::outer_v0::Config as OuterV0Config; -#[derive(Clone, Debug, PartialEq, serde::Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize)] pub struct Config { pub cmd: String, pub config_file: String, diff --git a/metasrv/src/configs/outer_v0.rs b/metasrv/src/configs/outer_v0.rs index 952913185d4e..abb83c0027c7 100644 --- a/metasrv/src/configs/outer_v0.rs +++ b/metasrv/src/configs/outer_v0.rs @@ -29,7 +29,7 @@ use serfig::parsers::Toml; use super::inner::Config as InnerConfig; use crate::version::METASRV_COMMIT_VERSION; -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Parser)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Parser)] #[clap(about, version = &**METASRV_COMMIT_VERSION, author)] #[serde(default)] pub struct Config { @@ -158,7 +158,7 @@ impl Config { /// #[serde(flatten)] doesn't work correctly for env. /// We should work around it by flatten them manully. /// We are seeking for better solutions. -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(default)] pub struct ConfigViaEnv { pub metasrv_config_file: String, @@ -268,7 +268,7 @@ impl Into for ConfigViaEnv { } } -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Parser)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Parser)] #[clap(about, version, author)] #[serde(default)] pub struct RaftConfig { diff --git a/metasrv/src/metrics/meta_metrics.rs b/metasrv/src/metrics/meta_metrics.rs index a247c8c869f8..c0064995b4d9 100644 --- a/metasrv/src/metrics/meta_metrics.rs +++ b/metasrv/src/metrics/meta_metrics.rs @@ -618,13 +618,12 @@ pub fn meta_metrics_to_prometheus_string() -> String { if let Err(e) = encoder.encode(®ISTRY.gather(), &mut buffer) { eprintln!("could not encode custom metrics: {}", e); }; - let res = match String::from_utf8(buffer.clone()) { + + match String::from_utf8(buffer.clone()) { Ok(v) => v, Err(e) => { eprintln!("custom metrics could not be from_utf8'd: {}", e); String::default() } - }; - - res + } } diff --git a/metasrv/src/version.rs b/metasrv/src/version.rs index 06f64971bcc7..e294b7198144 100644 --- a/metasrv/src/version.rs +++ b/metasrv/src/version.rs @@ -23,7 +23,7 @@ pub static METASRV_COMMIT_VERSION: Lazy = Lazy::new(|| { let rustc_semver = option_env!("VERGEN_RUSTC_SEMVER"); let timestamp = option_env!("VERGEN_BUILD_TIMESTAMP"); - let ver = match (build_semver, git_sha, rustc_semver, timestamp) { + match (build_semver, git_sha, rustc_semver, timestamp) { #[cfg(not(feature = "simd"))] (Some(v1), Some(v2), Some(v3), Some(v4)) => format!("{}-{}({}-{})", v1, v2, v3, v4), #[cfg(feature = "simd")] @@ -31,8 +31,7 @@ pub static METASRV_COMMIT_VERSION: Lazy = Lazy::new(|| { format!("{}-{}-simd({}-{})", v1, v2, v3, v4) } _ => String::new(), - }; - ver + } }); pub static METASRV_SEMVER: Lazy = Lazy::new(|| { diff --git a/query/src/api/rpc/exchange/exchange_manager.rs b/query/src/api/rpc/exchange/exchange_manager.rs index 78ee17461659..71dfdbceb680 100644 --- a/query/src/api/rpc/exchange/exchange_manager.rs +++ b/query/src/api/rpc/exchange/exchange_manager.rs @@ -160,7 +160,7 @@ impl DataExchangeManager { } async fn create_client(&self, address: &str) -> Result { - return match self.config.tls_query_cli_enabled() { + match self.config.tls_query_cli_enabled() { true => Ok(FlightClient::new(FlightServiceClient::new( ConnectionFactory::create_rpc_channel( address.to_owned(), @@ -172,7 +172,7 @@ impl DataExchangeManager { false => Ok(FlightClient::new(FlightServiceClient::new( ConnectionFactory::create_rpc_channel(address.to_owned(), None, None).await?, ))), - }; + } } async fn prepare_pipeline(&self, packets: &[ExecutorPacket], timeout: u64) -> Result<()> { @@ -618,7 +618,7 @@ impl QueryCoordinator { } async fn create_client(config: Config, address: &str) -> Result { - return match config.tls_query_cli_enabled() { + match config.tls_query_cli_enabled() { true => Ok(FlightClient::new(FlightServiceClient::new( ConnectionFactory::create_rpc_channel( address.to_owned(), @@ -630,7 +630,7 @@ impl QueryCoordinator { false => Ok(FlightClient::new(FlightServiceClient::new( ConnectionFactory::create_rpc_channel(address.to_owned(), None, None).await?, ))), - }; + } } fn spawn_pub_worker(&mut self, config: Config, addr: String) -> Result> { diff --git a/query/src/catalogs/default/mutable_catalog.rs b/query/src/catalogs/default/mutable_catalog.rs index 927867ce7198..e6f55872f4d4 100644 --- a/query/src/catalogs/default/mutable_catalog.rs +++ b/query/src/catalogs/default/mutable_catalog.rs @@ -90,8 +90,8 @@ impl MutableCatalog { pub async fn try_create_with_config(conf: Config) -> Result { let meta = { let provider = Arc::new(MetaStoreProvider::new(conf.meta.to_meta_grpc_client_conf())); - let meta_backend = provider.try_get_meta_store().await?; - meta_backend + + provider.try_get_meta_store().await? }; let tenant = conf.query.tenant_id.clone(); diff --git a/query/src/config/inner.rs b/query/src/config/inner.rs index 302c69a92ac5..1ca4829d2a21 100644 --- a/query/src/config/inner.rs +++ b/query/src/config/inner.rs @@ -32,7 +32,7 @@ use super::outer_v0::Config as OuterV0Config; /// Inner config for query. /// /// All function should implemented based on this Config. -#[derive(Clone, Default, Debug, PartialEq)] +#[derive(Clone, Default, Debug, PartialEq, Eq)] pub struct Config { pub cmd: String, pub config_file: String, @@ -92,7 +92,7 @@ impl Config { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct QueryConfig { /// Tenant id for get the information from the MetaSrv. pub tenant_id: String, @@ -211,7 +211,7 @@ impl QueryConfig { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum ThriftProtocol { Binary, // Compact, @@ -237,7 +237,7 @@ impl Display for ThriftProtocol { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct HiveCatalogConfig { pub meta_store_address: String, pub protocol: ThriftProtocol, @@ -252,7 +252,7 @@ impl Default for HiveCatalogConfig { } } -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Eq)] pub struct MetaConfig { /// The dir to store persisted meta state for a embedded meta store pub embedded_dir: String, diff --git a/query/src/config/outer_v0.rs b/query/src/config/outer_v0.rs index 89bf3d7ebb59..93250554907c 100644 --- a/query/src/config/outer_v0.rs +++ b/query/src/config/outer_v0.rs @@ -52,7 +52,7 @@ use crate::DATABEND_COMMIT_VERSION; /// It's forbidden to do any breaking changes on this struct. /// Only adding new fields is allowed. /// This same rules should be applied to all fields of this struct. -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Parser)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Parser)] #[clap(about, version = &**DATABEND_COMMIT_VERSION, author)] #[serde(default)] pub struct Config { @@ -156,7 +156,7 @@ impl TryInto for Config { } /// Storage config group. -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Args)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args)] #[serde(default)] pub struct StorageConfig { /// Current storage type: fs|s3 @@ -250,7 +250,7 @@ impl TryInto for StorageConfig { } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Args)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args)] #[serde(default)] pub struct FsStorageConfig { /// fs storage backend data path @@ -377,7 +377,7 @@ impl TryInto for S3StorageConfig { } } -#[derive(Clone, PartialEq, Serialize, Deserialize, Args)] +#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Args)] #[serde(default)] pub struct AzblobStorageConfig { /// Account for Azblob @@ -453,7 +453,7 @@ impl TryInto for AzblobStorageConfig { } } -#[derive(Clone, PartialEq, Serialize, Deserialize, Args, Debug)] +#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Args, Debug)] #[serde(default)] pub struct HdfsConfig { #[clap(long = "storage-hdfs-name-node", default_value_t)] @@ -493,7 +493,7 @@ impl TryInto for HdfsConfig { } /// Query config group. -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Args)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args)] #[serde(default)] pub struct QueryConfig { /// Tenant id for get the information from the MetaSrv. @@ -747,7 +747,7 @@ impl From for QueryConfig { } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Args)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args)] #[serde(default)] pub struct LogConfig { /// Log level @@ -794,7 +794,7 @@ impl From for LogConfig { } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Args)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args)] #[serde(default)] pub struct HiveCatalogConfig { #[clap(long = "hive-meta-store-address", default_value = "127.0.0.1:9083")] @@ -831,7 +831,7 @@ impl From for HiveCatalogConfig { /// Meta config group. /// TODO(xuanwo): All meta_xxx should be rename to xxx. -#[derive(Clone, PartialEq, Serialize, Deserialize, Args)] +#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Args)] #[serde(default)] pub struct MetaConfig { /// The dir to store persisted meta state for a embedded meta store diff --git a/query/src/interpreters/fragments/partition_state.rs b/query/src/interpreters/fragments/partition_state.rs index 972a6f224ba9..7e7aec57b62e 100644 --- a/query/src/interpreters/fragments/partition_state.rs +++ b/query/src/interpreters/fragments/partition_state.rs @@ -13,7 +13,7 @@ // limitations under the License. /// Partition status of data -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub enum PartitionState { Random, /*Broadcast,*/ diff --git a/query/src/interpreters/interpreter_copy.rs b/query/src/interpreters/interpreter_copy.rs index 043436252a3e..c416233e151c 100644 --- a/query/src/interpreters/interpreter_copy.rs +++ b/query/src/interpreters/interpreter_copy.rs @@ -63,7 +63,7 @@ impl CopyInterpreter { from: &ReadDataSourcePlan, files: &Vec, ) -> Result> { - let files = match &from.source_info { + match &from.source_info { SourceInfo::StageSource(table_info) => { let path = &table_info.path; // Here we add the path to the file: /path/to/path/file1. @@ -100,9 +100,7 @@ impl CopyInterpreter { "Cannot list files for the source info: {:?}", other ))), - }; - - files + } } // Rewrite the ReadDataSourcePlan.S3StageSource.file_name to new file name. diff --git a/query/src/interpreters/interpreter_copy_v2.rs b/query/src/interpreters/interpreter_copy_v2.rs index b4bc123583fc..93bec6a1b2cc 100644 --- a/query/src/interpreters/interpreter_copy_v2.rs +++ b/query/src/interpreters/interpreter_copy_v2.rs @@ -65,7 +65,7 @@ impl CopyInterpreterV2 { from: &ReadDataSourcePlan, files: &Vec, ) -> Result> { - let files = match &from.source_info { + match &from.source_info { SourceInfo::StageSource(table_info) => { let path = &table_info.path; // Here we add the path to the file: /path/to/path/file1. @@ -102,9 +102,7 @@ impl CopyInterpreterV2 { "Cannot list files for the source info: {:?}", other ))), - }; - - files + } } /// Rewrite the ReadDataSourcePlan.S3StageSource.file_name to new file name. diff --git a/query/src/interpreters/interpreter_show_databases.rs b/query/src/interpreters/interpreter_show_databases.rs index 42431cc52500..c9deeea23058 100644 --- a/query/src/interpreters/interpreter_show_databases.rs +++ b/query/src/interpreters/interpreter_show_databases.rs @@ -39,7 +39,7 @@ impl ShowDatabasesInterpreter { } fn build_query(&self) -> Result { - return match &self.plan.kind { + match &self.plan.kind { PlanShowKind::All => { Ok("SELECT name AS Database FROM system.databases ORDER BY name".to_string()) } @@ -51,7 +51,7 @@ impl ShowDatabasesInterpreter { "SELECT name As Database FROM system.databases WHERE {} ORDER BY name", v )), - }; + } } } diff --git a/query/src/interpreters/interpreter_show_functions.rs b/query/src/interpreters/interpreter_show_functions.rs index d5f0c30ee827..b73e28c1223f 100644 --- a/query/src/interpreters/interpreter_show_functions.rs +++ b/query/src/interpreters/interpreter_show_functions.rs @@ -39,7 +39,7 @@ impl ShowFunctionsInterpreter { } fn build_query(&self) -> Result { - return match &self.plan.kind { + match &self.plan.kind { PlanShowKind::All => Ok( "SELECT name, is_builtin, is_aggregate, definition, description FROM system.functions ORDER BY name" .to_string(), @@ -52,7 +52,7 @@ impl ShowFunctionsInterpreter { "SELECT name, is_builtin, is_aggregate, definition, description FROM system.functions WHERE {} ORDER BY name", v )), - }; + } } } diff --git a/query/src/interpreters/interpreter_show_tables_status.rs b/query/src/interpreters/interpreter_show_tables_status.rs index 0538360347f6..e0432a637ff8 100644 --- a/query/src/interpreters/interpreter_show_tables_status.rs +++ b/query/src/interpreters/interpreter_show_tables_status.rs @@ -65,7 +65,7 @@ impl ShowTablesStatusInterpreter { // `(select ${select_cols} from system.tables where ..)` // is used as a derived table. // (unlike mysql, alias of derived table is not required in databend). - return match &self.plan.kind { + match &self.plan.kind { PlanShowKind::All => Ok(format!( "SELECT * from (SELECT {} FROM system.tables WHERE database = '{}') \ ORDER BY Name", @@ -81,7 +81,7 @@ impl ShowTablesStatusInterpreter { WHERE ({}) ORDER BY Name", select_cols, database, v )), - }; + } } } diff --git a/query/src/pipelines/new/executor/pipeline_executor.rs b/query/src/pipelines/new/executor/pipeline_executor.rs index 20343987521f..07a302239900 100644 --- a/query/src/pipelines/new/executor/pipeline_executor.rs +++ b/query/src/pipelines/new/executor/pipeline_executor.rs @@ -178,7 +178,7 @@ impl PipelineExecutor { // Wake up other threads to finish when throw error self.finish()?; - return Err(cause.add_message_back(format!(" (while in processor thread {})", thread_num))); + Err(cause.add_message_back(format!(" (while in processor thread {})", thread_num))) } /// # Safety diff --git a/query/src/pipelines/new/executor/pipeline_pulling_executor.rs b/query/src/pipelines/new/executor/pipeline_pulling_executor.rs index 8c24edf1fcb8..ded4494a0cf2 100644 --- a/query/src/pipelines/new/executor/pipeline_pulling_executor.rs +++ b/query/src/pipelines/new/executor/pipeline_pulling_executor.rs @@ -142,14 +142,14 @@ impl PipelinePullingExecutor { } Ok(None) } else { - return match self.receiver.try_recv() { + match self.receiver.try_recv() { Ok(data_block) => data_block, // puller will not pull again once it received a None Err(err) => Err(ErrorCode::LogicalError(format!( "Logical error, try receiver error. after executor finish {}", err ))), - }; + } } } } diff --git a/query/src/servers/http/v1/query/execute_state.rs b/query/src/servers/http/v1/query/execute_state.rs index 82fac674b8f0..9f3451e14dde 100644 --- a/query/src/servers/http/v1/query/execute_state.rs +++ b/query/src/servers/http/v1/query/execute_state.rs @@ -63,7 +63,7 @@ use crate::storages::result::block_buffer::BlockBufferWriterWithResultTable; use crate::storages::result::ResultQueryInfo; use crate::storages::result::ResultTableSink; -#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialEq, Eq)] pub enum ExecuteStateKind { Running, Failed, diff --git a/query/src/servers/http/v1/query/expirable.rs b/query/src/servers/http/v1/query/expirable.rs index 1bf6b9f8d721..82cc844246fe 100644 --- a/query/src/servers/http/v1/query/expirable.rs +++ b/query/src/servers/http/v1/query/expirable.rs @@ -17,7 +17,7 @@ use std::time::Instant; use crate::sessions::SessionRef; -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub enum ExpiringState { InUse(String), // return Duration, so user can choose to use Systime or Instance diff --git a/query/src/servers/http/v1/query/http_query.rs b/query/src/servers/http/v1/query/http_query.rs index 519ccbdce7ce..455d3ffddf75 100644 --- a/query/src/servers/http/v1/query/http_query.rs +++ b/query/src/servers/http/v1/query/http_query.rs @@ -97,7 +97,7 @@ impl PaginationConf { } } -#[derive(Deserialize, Debug, Default, PartialEq)] +#[derive(Deserialize, Debug, Default, PartialEq, Eq)] #[serde(deny_unknown_fields)] pub struct HttpSessionConf { pub database: Option, @@ -105,7 +105,7 @@ pub struct HttpSessionConf { pub settings: Option>, } -#[derive(Deserialize, Debug, PartialEq)] +#[derive(Deserialize, Debug, PartialEq, Eq)] #[serde(untagged)] pub enum HttpSession { // keep New before old, so it deserialize to New when empty diff --git a/query/src/sql/planner/binder/bind_context.rs b/query/src/sql/planner/binder/bind_context.rs index 7f88189dbb75..d89bcfd2f7a0 100644 --- a/query/src/sql/planner/binder/bind_context.rs +++ b/query/src/sql/planner/binder/bind_context.rs @@ -22,7 +22,7 @@ use common_exception::Result; use super::AggregateInfo; use crate::sql::common::IndexType; -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct ColumnBinding { /// Table name of this `ColumnBinding` in current context pub table_name: Option, diff --git a/query/src/sql/planner/binder/select.rs b/query/src/sql/planner/binder/select.rs index e6b133782b3b..bb4fd9b8a9ef 100644 --- a/query/src/sql/planner/binder/select.rs +++ b/query/src/sql/planner/binder/select.rs @@ -251,9 +251,9 @@ impl<'a> Binder { all: &bool, ) -> Result<(SExpr, BindContext)> { let (left_expr, mut left_bind_context) = - self.bind_set_expr(bind_context, &*left, &[]).await?; + self.bind_set_expr(bind_context, left, &[]).await?; let (right_expr, mut right_bind_context) = - self.bind_set_expr(bind_context, &*right, &[]).await?; + self.bind_set_expr(bind_context, right, &[]).await?; if left_bind_context.columns.len() != right_bind_context.columns.len() { return Err(ErrorCode::SemanticError( "SetOperation must have the same number of columns", diff --git a/query/src/sql/planner/plans/copy_v2.rs b/query/src/sql/planner/plans/copy_v2.rs index 45255e15855a..65904a224b3f 100644 --- a/query/src/sql/planner/plans/copy_v2.rs +++ b/query/src/sql/planner/plans/copy_v2.rs @@ -23,7 +23,7 @@ use common_planners::ReadDataSourcePlan; use crate::sql::plans::Plan; -#[derive(serde::Serialize, serde::Deserialize, PartialEq, Clone, Debug)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Debug)] pub enum ValidationMode { None, ReturnNRows(u64), diff --git a/query/src/sql/planner/plans/operator.rs b/query/src/sql/planner/plans/operator.rs index 8ef2c5312618..55348a776b35 100644 --- a/query/src/sql/planner/plans/operator.rs +++ b/query/src/sql/planner/plans/operator.rs @@ -58,7 +58,7 @@ pub trait PhysicalPlan { } /// Relational operator -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub enum RelOp { // Logical operators LogicalGet, diff --git a/query/src/sql/planner/plans/scalar.rs b/query/src/sql/planner/plans/scalar.rs index b3e727a95457..54571b5ffba4 100644 --- a/query/src/sql/planner/plans/scalar.rs +++ b/query/src/sql/planner/plans/scalar.rs @@ -266,7 +266,7 @@ impl TryFrom for SubqueryExpr { } } -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct BoundColumnRef { pub column: ColumnBinding, } @@ -285,7 +285,7 @@ impl ScalarExpr for BoundColumnRef { } } -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct ConstantExpr { pub value: DataValue, @@ -352,7 +352,7 @@ impl ScalarExpr for OrExpr { } } -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub enum ComparisonOp { Equal, NotEqual, diff --git a/query/src/sql/sql_statement.rs b/query/src/sql/sql_statement.rs index ffd9d0233052..d92f3c221b11 100644 --- a/query/src/sql/sql_statement.rs +++ b/query/src/sql/sql_statement.rs @@ -183,7 +183,7 @@ pub enum DfStatement<'a> { /// Comment hints from SQL. /// It'll be enabled when using `--comment` in mysql client. /// Eg: `SELECT * FROM system.number LIMIT 1; -- { ErrorCode 25 }` -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfHint { pub error_code: Option, pub comment: String, diff --git a/query/src/sql/statements/analyzer_expr_sync.rs b/query/src/sql/statements/analyzer_expr_sync.rs index 86122687c7d7..0b80d5158e52 100644 --- a/query/src/sql/statements/analyzer_expr_sync.rs +++ b/query/src/sql/statements/analyzer_expr_sync.rs @@ -265,12 +265,11 @@ impl ExpressionSyncAnalyzer { k @ Value::Number(_, _) => format!("[{}]", k), Value::SingleQuotedString(s) => format!("[\"{}\"]", s), Value::ColonString(s) => { - let key = if i == 0 { + if i == 0 { s.to_string() } else { format!(":{}", s) - }; - key + } } Value::PeriodString(s) => format!(".{}", s), _ => format!("[{}]", k), diff --git a/query/src/sql/statements/statement_alter_database.rs b/query/src/sql/statements/statement_alter_database.rs index f0d632eb9f15..1fdb87cd33a0 100644 --- a/query/src/sql/statements/statement_alter_database.rs +++ b/query/src/sql/statements/statement_alter_database.rs @@ -26,14 +26,14 @@ use crate::sql::statements::resolve_database; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfAlterDatabase { pub if_exists: bool, pub database_name: ObjectName, pub action: AlterDatabaseAction, } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum AlterDatabaseAction { RenameDatabase(ObjectName), } diff --git a/query/src/sql/statements/statement_alter_table.rs b/query/src/sql/statements/statement_alter_table.rs index 3a35d2157bc4..d7628d18a765 100644 --- a/query/src/sql/statements/statement_alter_table.rs +++ b/query/src/sql/statements/statement_alter_table.rs @@ -32,14 +32,14 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfAlterTable { pub if_exists: bool, pub table: ObjectName, pub action: AlterTableAction, } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum AlterTableAction { RenameTable(ObjectName), AlterTableClusterKey(Vec), diff --git a/query/src/sql/statements/statement_alter_udf.rs b/query/src/sql/statements/statement_alter_udf.rs index 3ad849de9a24..448f840c3071 100644 --- a/query/src/sql/statements/statement_alter_udf.rs +++ b/query/src/sql/statements/statement_alter_udf.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfAlterUDF { pub udf_name: String, pub parameters: Vec, diff --git a/query/src/sql/statements/statement_alter_user.rs b/query/src/sql/statements/statement_alter_user.rs index f8b6ae5aa05c..7c0e1fbbb4a9 100644 --- a/query/src/sql/statements/statement_alter_user.rs +++ b/query/src/sql/statements/statement_alter_user.rs @@ -26,7 +26,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfUserWithOption; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfAlterUser { pub if_current_user: bool, pub user: UserIdentity, diff --git a/query/src/sql/statements/statement_alter_view.rs b/query/src/sql/statements/statement_alter_view.rs index 4aca83d3dc18..1911f13a2241 100644 --- a/query/src/sql/statements/statement_alter_view.rs +++ b/query/src/sql/statements/statement_alter_view.rs @@ -26,7 +26,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfQueryStatement; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfAlterView { /// View Name pub name: ObjectName, diff --git a/query/src/sql/statements/statement_call.rs b/query/src/sql/statements/statement_call.rs index 79736b16e518..c52a1f70d2be 100644 --- a/query/src/sql/statements/statement_call.rs +++ b/query/src/sql/statements/statement_call.rs @@ -23,7 +23,7 @@ use super::AnalyzableStatement; use crate::sessions::QueryContext; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfCall { pub name: String, pub args: Vec, diff --git a/query/src/sql/statements/statement_copy.rs b/query/src/sql/statements/statement_copy.rs index ceec92b97940..d8d5f09ec4b6 100644 --- a/query/src/sql/statements/statement_copy.rs +++ b/query/src/sql/statements/statement_copy.rs @@ -43,7 +43,7 @@ use crate::sql::statements::AnalyzedResult; use crate::sql::DfStatement; use crate::sql::PlanParser; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfCopy { pub name: ObjectName, pub columns: Vec, diff --git a/query/src/sql/statements/statement_create_database.rs b/query/src/sql/statements/statement_create_database.rs index dce955f6cfd8..36edf9326973 100644 --- a/query/src/sql/statements/statement_create_database.rs +++ b/query/src/sql/statements/statement_create_database.rs @@ -27,7 +27,7 @@ use crate::sql::statements::resolve_database; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfCreateDatabase { pub if_not_exists: bool, pub name: ObjectName, diff --git a/query/src/sql/statements/statement_create_role.rs b/query/src/sql/statements/statement_create_role.rs index 4d0b59d00e31..6c491440c6ec 100644 --- a/query/src/sql/statements/statement_create_role.rs +++ b/query/src/sql/statements/statement_create_role.rs @@ -23,7 +23,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfCreateRole { pub if_not_exists: bool, pub role_name: String, diff --git a/query/src/sql/statements/statement_create_table.rs b/query/src/sql/statements/statement_create_table.rs index 2c5d139c2871..c91f6d24516c 100644 --- a/query/src/sql/statements/statement_create_table.rs +++ b/query/src/sql/statements/statement_create_table.rs @@ -44,7 +44,7 @@ use crate::sql::PlanParser; use crate::sql::SQLCommon; use crate::sql::OPT_KEY_DATABASE_ID; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfCreateTable { pub if_not_exists: bool, /// Table name diff --git a/query/src/sql/statements/statement_create_udf.rs b/query/src/sql/statements/statement_create_udf.rs index 6cff7ab8a0a5..e2d920752de0 100644 --- a/query/src/sql/statements/statement_create_udf.rs +++ b/query/src/sql/statements/statement_create_udf.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfCreateUDF { pub if_not_exists: bool, pub udf_name: String, diff --git a/query/src/sql/statements/statement_create_user.rs b/query/src/sql/statements/statement_create_user.rs index 879603f680b9..6291ef34bf05 100644 --- a/query/src/sql/statements/statement_create_user.rs +++ b/query/src/sql/statements/statement_create_user.rs @@ -28,7 +28,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct DfAuthOption { pub auth_type: Option, pub by_value: Option, @@ -43,7 +43,7 @@ impl DfAuthOption { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum DfUserWithOption { TenantSetting, NoTenantSetting, @@ -84,7 +84,7 @@ impl DfUserWithOption { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfCreateUser { pub if_not_exists: bool, pub user: UserIdentity, diff --git a/query/src/sql/statements/statement_create_user_stage.rs b/query/src/sql/statements/statement_create_user_stage.rs index 9e7f8cad4928..008901f311d2 100644 --- a/query/src/sql/statements/statement_create_user_stage.rs +++ b/query/src/sql/statements/statement_create_user_stage.rs @@ -31,7 +31,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct DfCreateUserStage { pub if_not_exists: bool, pub stage_name: String, diff --git a/query/src/sql/statements/statement_create_view.rs b/query/src/sql/statements/statement_create_view.rs index 145dd6a54c1f..d0da03c28470 100644 --- a/query/src/sql/statements/statement_create_view.rs +++ b/query/src/sql/statements/statement_create_view.rs @@ -27,7 +27,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfQueryStatement; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfCreateView { pub if_not_exists: bool, /// View Name diff --git a/query/src/sql/statements/statement_delete.rs b/query/src/sql/statements/statement_delete.rs index e94b76afffe1..b6386a620ddb 100644 --- a/query/src/sql/statements/statement_delete.rs +++ b/query/src/sql/statements/statement_delete.rs @@ -34,7 +34,7 @@ use crate::sql::statements::ExpressionAnalyzer; use crate::sql::statements::QueryRelation; use crate::storages::view::view_table::VIEW_ENGINE; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDeleteStatement { pub name: ObjectName, pub selection: Option, diff --git a/query/src/sql/statements/statement_describe_table.rs b/query/src/sql/statements/statement_describe_table.rs index 8ac3c3d6b14d..d9c0ac966853 100644 --- a/query/src/sql/statements/statement_describe_table.rs +++ b/query/src/sql/statements/statement_describe_table.rs @@ -26,7 +26,7 @@ use crate::sql::statements::resolve_table; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDescribeTable { pub name: ObjectName, } diff --git a/query/src/sql/statements/statement_describe_user_stage.rs b/query/src/sql/statements/statement_describe_user_stage.rs index a08d2f6580e6..0a669d360662 100644 --- a/query/src/sql/statements/statement_describe_user_stage.rs +++ b/query/src/sql/statements/statement_describe_user_stage.rs @@ -25,7 +25,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDescribeUserStage { pub name: ObjectName, } diff --git a/query/src/sql/statements/statement_drop_database.rs b/query/src/sql/statements/statement_drop_database.rs index a996d88e7d8c..02042e91d81f 100644 --- a/query/src/sql/statements/statement_drop_database.rs +++ b/query/src/sql/statements/statement_drop_database.rs @@ -25,7 +25,7 @@ use crate::sql::statements::resolve_database; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDropDatabase { pub if_exists: bool, pub name: ObjectName, diff --git a/query/src/sql/statements/statement_drop_role.rs b/query/src/sql/statements/statement_drop_role.rs index c70777849fc8..0509a77eb104 100644 --- a/query/src/sql/statements/statement_drop_role.rs +++ b/query/src/sql/statements/statement_drop_role.rs @@ -23,7 +23,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDropRole { pub if_exists: bool, pub role_name: String, diff --git a/query/src/sql/statements/statement_drop_table.rs b/query/src/sql/statements/statement_drop_table.rs index a3e66d975e8c..78022191636f 100644 --- a/query/src/sql/statements/statement_drop_table.rs +++ b/query/src/sql/statements/statement_drop_table.rs @@ -25,7 +25,7 @@ use crate::sql::statements::resolve_table; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDropTable { pub if_exists: bool, pub name: ObjectName, diff --git a/query/src/sql/statements/statement_drop_udf.rs b/query/src/sql/statements/statement_drop_udf.rs index 1e78cd7a2539..6f9e924b9b47 100644 --- a/query/src/sql/statements/statement_drop_udf.rs +++ b/query/src/sql/statements/statement_drop_udf.rs @@ -23,7 +23,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDropUDF { pub if_exists: bool, pub udf_name: String, diff --git a/query/src/sql/statements/statement_drop_user.rs b/query/src/sql/statements/statement_drop_user.rs index 2f5b9c919fb7..8e97f083a004 100644 --- a/query/src/sql/statements/statement_drop_user.rs +++ b/query/src/sql/statements/statement_drop_user.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDropUser { pub if_exists: bool, pub user: UserIdentity, diff --git a/query/src/sql/statements/statement_drop_user_stage.rs b/query/src/sql/statements/statement_drop_user_stage.rs index 987f52ced2d0..794fa0500037 100644 --- a/query/src/sql/statements/statement_drop_user_stage.rs +++ b/query/src/sql/statements/statement_drop_user_stage.rs @@ -23,7 +23,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDropUserStage { pub if_exists: bool, pub name: String, diff --git a/query/src/sql/statements/statement_drop_view.rs b/query/src/sql/statements/statement_drop_view.rs index 0b74a10e306f..b61e5e01f41a 100644 --- a/query/src/sql/statements/statement_drop_view.rs +++ b/query/src/sql/statements/statement_drop_view.rs @@ -25,7 +25,7 @@ use crate::sql::statements::resolve_table; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfDropView { pub if_exists: bool, pub name: ObjectName, diff --git a/query/src/sql/statements/statement_exists_table.rs b/query/src/sql/statements/statement_exists_table.rs index da2593b91576..849ef0e63e46 100644 --- a/query/src/sql/statements/statement_exists_table.rs +++ b/query/src/sql/statements/statement_exists_table.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfExistsTable { pub name: ObjectName, } diff --git a/query/src/sql/statements/statement_grant.rs b/query/src/sql/statements/statement_grant.rs index bd76f7842871..cc6fabbac3e1 100644 --- a/query/src/sql/statements/statement_grant.rs +++ b/query/src/sql/statements/statement_grant.rs @@ -27,14 +27,14 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfGrantPrivilegeStatement { pub principal: PrincipalIdentity, pub priv_types: UserPrivilegeSet, pub on: DfGrantObject, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum DfGrantObject { Global, Database(Option), @@ -85,7 +85,7 @@ impl AnalyzableStatement for DfGrantPrivilegeStatement { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfGrantRoleStatement { pub role: String, pub principal: PrincipalIdentity, diff --git a/query/src/sql/statements/statement_insert.rs b/query/src/sql/statements/statement_insert.rs index 2ee0e181f05f..055b9e884e8b 100644 --- a/query/src/sql/statements/statement_insert.rs +++ b/query/src/sql/statements/statement_insert.rs @@ -46,7 +46,7 @@ use crate::sql::DfStatement; use crate::sql::PlanParser; use crate::storages::Table; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfInsertStatement<'a> { pub or: Option, /// TABLE @@ -69,7 +69,7 @@ pub struct DfInsertStatement<'a> { pub on: Option, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum InsertSource<'a> { /// for insert format Empty, diff --git a/query/src/sql/statements/statement_kill.rs b/query/src/sql/statements/statement_kill.rs index ae3dcb5be6fa..4772fd3ea205 100644 --- a/query/src/sql/statements/statement_kill.rs +++ b/query/src/sql/statements/statement_kill.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfKillStatement { pub object_id: Ident, pub kill_query: bool, diff --git a/query/src/sql/statements/statement_list.rs b/query/src/sql/statements/statement_list.rs index 9a93da762c5c..02a2bac225f7 100644 --- a/query/src/sql/statements/statement_list.rs +++ b/query/src/sql/statements/statement_list.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfList { pub location: String, pub pattern: String, diff --git a/query/src/sql/statements/statement_optimize_table.rs b/query/src/sql/statements/statement_optimize_table.rs index 36bb12c27f1c..c53c5946d7cb 100644 --- a/query/src/sql/statements/statement_optimize_table.rs +++ b/query/src/sql/statements/statement_optimize_table.rs @@ -25,7 +25,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfOptimizeTable { pub name: ObjectName, pub action: OptimizeTableAction, diff --git a/query/src/sql/statements/statement_remove_user_stage.rs b/query/src/sql/statements/statement_remove_user_stage.rs index 15ccaf8827f9..06861db85362 100644 --- a/query/src/sql/statements/statement_remove_user_stage.rs +++ b/query/src/sql/statements/statement_remove_user_stage.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct DfRemoveStage { pub location: String, pub pattern: String, diff --git a/query/src/sql/statements/statement_rename_table.rs b/query/src/sql/statements/statement_rename_table.rs index 2b344b10430c..5b6ba1813eb9 100644 --- a/query/src/sql/statements/statement_rename_table.rs +++ b/query/src/sql/statements/statement_rename_table.rs @@ -27,7 +27,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfRenameTable { pub name_map: HashMap, } diff --git a/query/src/sql/statements/statement_revoke.rs b/query/src/sql/statements/statement_revoke.rs index eac9e725c69c..46f4d9ec7f05 100644 --- a/query/src/sql/statements/statement_revoke.rs +++ b/query/src/sql/statements/statement_revoke.rs @@ -27,7 +27,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfGrantObject; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfRevokePrivilegeStatement { pub principal: PrincipalIdentity, pub priv_types: UserPrivilegeSet, @@ -56,7 +56,7 @@ impl AnalyzableStatement for DfRevokePrivilegeStatement { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfRevokeRoleStatement { pub role: String, pub principal: PrincipalIdentity, diff --git a/query/src/sql/statements/statement_select.rs b/query/src/sql/statements/statement_select.rs index ce83f8886b41..dfa4131af59e 100644 --- a/query/src/sql/statements/statement_select.rs +++ b/query/src/sql/statements/statement_select.rs @@ -45,7 +45,7 @@ use crate::sql::statements::AnalyzedResult; use crate::sql::statements::QueryRelation; use crate::storages::ToReadDataSourcePlan; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfQueryStatement { pub distinct: bool, pub from: Vec, diff --git a/query/src/sql/statements/statement_set_variable.rs b/query/src/sql/statements/statement_set_variable.rs index c0ad86bbe029..e15efc487f08 100644 --- a/query/src/sql/statements/statement_set_variable.rs +++ b/query/src/sql/statements/statement_set_variable.rs @@ -27,7 +27,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfSetVariable { pub local: bool, pub hivevar: bool, diff --git a/query/src/sql/statements/statement_show_create_database.rs b/query/src/sql/statements/statement_show_create_database.rs index de7bee4c8a5e..0b4b3ee34deb 100644 --- a/query/src/sql/statements/statement_show_create_database.rs +++ b/query/src/sql/statements/statement_show_create_database.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowCreateDatabase { pub name: ObjectName, } diff --git a/query/src/sql/statements/statement_show_create_table.rs b/query/src/sql/statements/statement_show_create_table.rs index 1babbb27fa7d..9eda7abd8846 100644 --- a/query/src/sql/statements/statement_show_create_table.rs +++ b/query/src/sql/statements/statement_show_create_table.rs @@ -25,7 +25,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowCreateTable { pub name: ObjectName, } diff --git a/query/src/sql/statements/statement_show_databases.rs b/query/src/sql/statements/statement_show_databases.rs index ccd5a5f00176..985f75f08c40 100644 --- a/query/src/sql/statements/statement_show_databases.rs +++ b/query/src/sql/statements/statement_show_databases.rs @@ -26,7 +26,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfShowKind; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowDatabases { pub kind: DfShowKind, } diff --git a/query/src/sql/statements/statement_show_engines.rs b/query/src/sql/statements/statement_show_engines.rs index b564e1de0327..0b2d918022d5 100644 --- a/query/src/sql/statements/statement_show_engines.rs +++ b/query/src/sql/statements/statement_show_engines.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowEngines; #[async_trait::async_trait] diff --git a/query/src/sql/statements/statement_show_functions.rs b/query/src/sql/statements/statement_show_functions.rs index b06f21a7035b..6676f471f740 100644 --- a/query/src/sql/statements/statement_show_functions.rs +++ b/query/src/sql/statements/statement_show_functions.rs @@ -26,7 +26,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfShowKind; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowFunctions { pub kind: DfShowKind, } diff --git a/query/src/sql/statements/statement_show_grants.rs b/query/src/sql/statements/statement_show_grants.rs index f928814d638b..4fe44be934fd 100644 --- a/query/src/sql/statements/statement_show_grants.rs +++ b/query/src/sql/statements/statement_show_grants.rs @@ -25,7 +25,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowGrants { pub principal: Option, } diff --git a/query/src/sql/statements/statement_show_kind.rs b/query/src/sql/statements/statement_show_kind.rs index e44580daca0d..4351b3c111c6 100644 --- a/query/src/sql/statements/statement_show_kind.rs +++ b/query/src/sql/statements/statement_show_kind.rs @@ -15,7 +15,7 @@ use sqlparser::ast::Expr; use sqlparser::ast::Ident; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum DfShowKind { All, Like(Ident), diff --git a/query/src/sql/statements/statement_show_metrics.rs b/query/src/sql/statements/statement_show_metrics.rs index 3e3ea879f6ad..5a2d7c609208 100644 --- a/query/src/sql/statements/statement_show_metrics.rs +++ b/query/src/sql/statements/statement_show_metrics.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowMetrics; #[async_trait::async_trait] diff --git a/query/src/sql/statements/statement_show_processlist.rs b/query/src/sql/statements/statement_show_processlist.rs index c0bb72467d52..faab03c1fcf1 100644 --- a/query/src/sql/statements/statement_show_processlist.rs +++ b/query/src/sql/statements/statement_show_processlist.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowProcessList; #[async_trait::async_trait] diff --git a/query/src/sql/statements/statement_show_roles.rs b/query/src/sql/statements/statement_show_roles.rs index ca313eb5fa45..b2aa6f1783fc 100644 --- a/query/src/sql/statements/statement_show_roles.rs +++ b/query/src/sql/statements/statement_show_roles.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowRoles; #[async_trait::async_trait] diff --git a/query/src/sql/statements/statement_show_settings.rs b/query/src/sql/statements/statement_show_settings.rs index 4a6441e6b59c..4ed93e53e2a6 100644 --- a/query/src/sql/statements/statement_show_settings.rs +++ b/query/src/sql/statements/statement_show_settings.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowSettings; #[async_trait::async_trait] diff --git a/query/src/sql/statements/statement_show_stages.rs b/query/src/sql/statements/statement_show_stages.rs index 4524ebc2a0c1..1d2a5796da38 100644 --- a/query/src/sql/statements/statement_show_stages.rs +++ b/query/src/sql/statements/statement_show_stages.rs @@ -24,7 +24,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfShowKind; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowStages { pub kind: DfShowKind, } diff --git a/query/src/sql/statements/statement_show_tab_stat.rs b/query/src/sql/statements/statement_show_tab_stat.rs index 2b61613bc1ff..31ef5208cb71 100644 --- a/query/src/sql/statements/statement_show_tab_stat.rs +++ b/query/src/sql/statements/statement_show_tab_stat.rs @@ -26,7 +26,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfShowKind; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowTablesStatus { pub kind: DfShowKind, pub fromdb: Option, diff --git a/query/src/sql/statements/statement_show_tables.rs b/query/src/sql/statements/statement_show_tables.rs index 86890eb8bbc9..55851960506d 100644 --- a/query/src/sql/statements/statement_show_tables.rs +++ b/query/src/sql/statements/statement_show_tables.rs @@ -26,7 +26,7 @@ use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; use crate::sql::statements::DfShowKind; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowTables { pub kind: DfShowKind, pub showfull: bool, diff --git a/query/src/sql/statements/statement_show_users.rs b/query/src/sql/statements/statement_show_users.rs index e6d6bf520532..1d76c3ed4c23 100644 --- a/query/src/sql/statements/statement_show_users.rs +++ b/query/src/sql/statements/statement_show_users.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfShowUsers; #[async_trait::async_trait] diff --git a/query/src/sql/statements/statement_truncate_table.rs b/query/src/sql/statements/statement_truncate_table.rs index 1481f9edae7d..1f3f8f2d9a3d 100644 --- a/query/src/sql/statements/statement_truncate_table.rs +++ b/query/src/sql/statements/statement_truncate_table.rs @@ -24,7 +24,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfTruncateTable { pub name: ObjectName, pub purge: bool, diff --git a/query/src/sql/statements/statement_undrop_database.rs b/query/src/sql/statements/statement_undrop_database.rs index b9d8996d34de..167297da1c13 100644 --- a/query/src/sql/statements/statement_undrop_database.rs +++ b/query/src/sql/statements/statement_undrop_database.rs @@ -25,7 +25,7 @@ use crate::sql::statements::resolve_database; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfUndropDatabase { pub name: ObjectName, } diff --git a/query/src/sql/statements/statement_undrop_table.rs b/query/src/sql/statements/statement_undrop_table.rs index 35e7f094c6f9..e3b2a9956c8e 100644 --- a/query/src/sql/statements/statement_undrop_table.rs +++ b/query/src/sql/statements/statement_undrop_table.rs @@ -25,7 +25,7 @@ use crate::sql::statements::resolve_table; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfUndropTable { pub name: ObjectName, } diff --git a/query/src/sql/statements/statement_use_database.rs b/query/src/sql/statements/statement_use_database.rs index 74310d8c6031..b47d89113ad8 100644 --- a/query/src/sql/statements/statement_use_database.rs +++ b/query/src/sql/statements/statement_use_database.rs @@ -25,7 +25,7 @@ use crate::sessions::QueryContext; use crate::sql::statements::AnalyzableStatement; use crate::sql::statements::AnalyzedResult; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct DfUseDatabase { pub name: ObjectName, } diff --git a/query/src/storages/fuse/fuse_part.rs b/query/src/storages/fuse/fuse_part.rs index d7a81653a12f..86767174aed9 100644 --- a/query/src/storages/fuse/fuse_part.rs +++ b/query/src/storages/fuse/fuse_part.rs @@ -23,7 +23,7 @@ use common_planners::PartInfoPtr; use crate::storages::fuse::meta::Compression; -#[derive(serde::Serialize, serde::Deserialize, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq)] pub struct ColumnMeta { pub offset: u64, pub length: u64, @@ -40,7 +40,7 @@ impl ColumnMeta { } } -#[derive(serde::Serialize, serde::Deserialize, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq)] pub struct FusePartInfo { pub location: String, /// FusePartInfo itself is not versioned diff --git a/query/src/storages/fuse/meta/common.rs b/query/src/storages/fuse/meta/common.rs index 3a14e15b34b6..d99e4a8437f6 100644 --- a/query/src/storages/fuse/meta/common.rs +++ b/query/src/storages/fuse/meta/common.rs @@ -44,7 +44,7 @@ where Self: Sized const VERSION: u64 = V; } -#[derive(Serialize, Deserialize, PartialEq, Copy, Clone, Debug)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Copy, Clone, Debug)] pub enum Compression { Lz4, Lz4Raw, diff --git a/query/src/storages/fuse/operations/delete.rs b/query/src/storages/fuse/operations/delete.rs index ffa1ef6b5c0d..078dbe541dce 100644 --- a/query/src/storages/fuse/operations/delete.rs +++ b/query/src/storages/fuse/operations/delete.rs @@ -56,9 +56,8 @@ impl FuseTable { "unconditionally delete from table, {}.{}.{}", plan.catalog_name, plan.database_name, plan.table_name ); - return self - .do_truncate(ctx.clone(), purge, plan.catalog_name.as_str()) - .await; + self.do_truncate(ctx.clone(), purge, plan.catalog_name.as_str()) + .await } } diff --git a/query/src/storages/index/bloom_filter.rs b/query/src/storages/index/bloom_filter.rs index aafd9ec4222d..cc396cce3a7e 100644 --- a/query/src/storages/index/bloom_filter.rs +++ b/query/src/storages/index/bloom_filter.rs @@ -34,7 +34,7 @@ use crate::storages::index::IndexSchemaVersion; /// of the nonexistent of value '12' in column 'age'. Otherwise should return 'Unknown'. /// /// If the column is not applicable for bloom filter, like TypeID::struct, NotApplicable is used. -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum BloomFilterExprEvalResult { False, Unknown, diff --git a/query/src/storages/index/index_min_max.rs b/query/src/storages/index/index_min_max.rs index 671de9ec1eab..bd4167b82409 100644 --- a/query/src/storages/index/index_min_max.rs +++ b/query/src/storages/index/index_min_max.rs @@ -22,7 +22,7 @@ use common_planners::Expression; use crate::storages::index::IndexSchemaVersion; /// Min and Max index. -#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] pub struct MinMaxIndex { pub col: String, pub min: DataValue, diff --git a/query/src/storages/index/index_sparse.rs b/query/src/storages/index/index_sparse.rs index 00cc3ebfc42c..eeedeacc88ab 100644 --- a/query/src/storages/index/index_sparse.rs +++ b/query/src/storages/index/index_sparse.rs @@ -21,7 +21,7 @@ use common_planners::Expression; use crate::storages::index::IndexSchemaVersion; -#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] pub struct SparseIndexValue { // Min value of this granule. pub min: DataValue, @@ -32,7 +32,7 @@ pub struct SparseIndexValue { } /// Sparse index. -#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] pub struct SparseIndex { pub col: String, // Sparse index. diff --git a/query/src/storages/index/mod.rs b/query/src/storages/index/mod.rs index 6c7241a5ff2e..8a598ff70fd9 100644 --- a/query/src/storages/index/mod.rs +++ b/query/src/storages/index/mod.rs @@ -29,7 +29,7 @@ pub use range_filter::ColumnStatistics; pub use range_filter::RangeFilter; pub use range_filter::StatisticsOfColumns; -#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] pub enum IndexSchemaVersion { V1, } diff --git a/query/src/storages/memory/memory_part.rs b/query/src/storages/memory/memory_part.rs index 6f049ea056dc..27e15941e816 100644 --- a/query/src/storages/memory/memory_part.rs +++ b/query/src/storages/memory/memory_part.rs @@ -20,7 +20,7 @@ use common_exception::Result; use common_planners::PartInfo; use common_planners::PartInfoPtr; -#[derive(serde::Serialize, serde::Deserialize, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq)] pub struct MemoryPartInfo { pub total: usize, pub part_start: usize, diff --git a/query/src/storages/random/random_parts.rs b/query/src/storages/random/random_parts.rs index 58da1ce8044b..9bb6a974d6d0 100644 --- a/query/src/storages/random/random_parts.rs +++ b/query/src/storages/random/random_parts.rs @@ -20,7 +20,7 @@ use common_exception::Result; use common_planners::PartInfo; use common_planners::PartInfoPtr; -#[derive(serde::Serialize, serde::Deserialize, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq)] pub struct RandomPartInfo { pub rows: usize, } diff --git a/query/src/table_functions/numbers_part.rs b/query/src/table_functions/numbers_part.rs index 4da3fa37f363..02b9265a63e7 100644 --- a/query/src/table_functions/numbers_part.rs +++ b/query/src/table_functions/numbers_part.rs @@ -21,7 +21,7 @@ use common_exception::Result; use common_planners::PartInfo; use common_planners::PartInfoPtr; -#[derive(serde::Serialize, serde::Deserialize, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq)] pub struct NumbersPartInfo { pub total: u64, pub part_start: u64, diff --git a/query/src/version.rs b/query/src/version.rs index 8dc3675c3998..e7d92f325e56 100644 --- a/query/src/version.rs +++ b/query/src/version.rs @@ -20,7 +20,7 @@ pub static DATABEND_COMMIT_VERSION: Lazy = Lazy::new(|| { let rustc_semver = option_env!("VERGEN_RUSTC_SEMVER"); let timestamp = option_env!("VERGEN_BUILD_TIMESTAMP"); - let ver = match (git_tag, git_sha, rustc_semver, timestamp) { + match (git_tag, git_sha, rustc_semver, timestamp) { #[cfg(not(feature = "simd"))] (Some(v1), Some(v2), Some(v3), Some(v4)) => format!("{}-{}(rust-{}-{})", v1, v2, v3, v4), #[cfg(feature = "simd")] @@ -28,8 +28,7 @@ pub static DATABEND_COMMIT_VERSION: Lazy = Lazy::new(|| { format!("{}-{}-simd(rust-{}-{})", v1, v2, v3, v4) } _ => String::new(), - }; - ver + } }); pub static QUERY_SEMVER: Lazy = Lazy::new(|| { diff --git a/query/tests/it/servers/http/http_query_handlers.rs b/query/tests/it/servers/http/http_query_handlers.rs index 832d49c7dcf4..cbdabcef7da3 100644 --- a/query/tests/it/servers/http/http_query_handlers.rs +++ b/query/tests/it/servers/http/http_query_handlers.rs @@ -1057,8 +1057,8 @@ async fn test_http_service_tls_server_mutual_tls_failed() -> Result<()> { pub async fn download(ep: &EndpointType, query_id: &str) -> Response { let uri = format!("/v1/query/{}/download", query_id); - let resp = get_uri(ep, &uri).await; - resp + + get_uri(ep, &uri).await } async fn test_download(v2: u64) -> Result<()> { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index bc8867389dac..328e8d62294b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2022-05-19" +channel = "nightly-2022-06-30" components = ["rustfmt", "clippy"] diff --git a/rustfmt.toml b/rustfmt.toml index ca2c17fc9a31..842f197a8474 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -4,5 +4,4 @@ imports_granularity = "Item" group_imports = "StdExternalCrate" where_single_line = true trailing_comma = "Vertical" -report_fixme = "Unnumbered" overflow_delimited_expr = true diff --git a/tools/metactl/src/main.rs b/tools/metactl/src/main.rs index 6a68f5e2db1d..3ee5b9e25d68 100644 --- a/tools/metactl/src/main.rs +++ b/tools/metactl/src/main.rs @@ -30,7 +30,7 @@ use serde::Serialize; /// TODO(xuanwo) /// /// We should make metactl config keeps backward compatibility too. -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Parser)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Parser)] #[clap(about, version = &**METASRV_COMMIT_VERSION, author)] pub struct Config { /// Run a command @@ -65,7 +65,7 @@ pub struct Config { } /// TODO: This is a temp copy of RaftConfig, we will migrate them in the future. -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Parser)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Parser)] #[clap(about, version, author)] #[serde(default)] pub struct RaftConfig {