Skip to content

Commit

Permalink
Merge pull request #239 from SpringQL/fix_clippy_lint
Browse files Browse the repository at this point in the history
refactor: fix clippy lint
  • Loading branch information
laysakura committed Aug 31, 2022
2 parents e74ce51 + 0357b1e commit 92abd52
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion springql-core/src/expression/boolean_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::expression::ValueExprType;

/// Boolean expression.
#[allow(clippy::enum_variant_names)]
#[derive(Clone, PartialEq, Hash, Debug)]
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub enum BinaryExpr<E>
where
E: ValueExprType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::expression::ValueExprType;

/// Comparison function and its operands
#[derive(Clone, PartialEq, Hash, Debug)]
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub enum ComparisonFunction<E>
where
E: ValueExprType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::expression::ValueExprType;

/// AND, OR, NOT
#[derive(Clone, PartialEq, Hash, Debug)]
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub enum LogicalFunction<E>
where
E: ValueExprType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::expression::ValueExprType;

#[derive(Clone, PartialEq, Hash, Debug)]
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub enum NumericalFunction<E>
where
E: ValueExprType,
Expand Down
2 changes: 1 addition & 1 deletion springql-core/src/expression/function_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::expression::ValueExprType;

#[derive(Clone, PartialEq, Hash, Debug)]
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub enum FunctionCall<E>
where
E: ValueExprType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use aggregate::{AggregateFunctionParameter, AggregateParameter, GroupByLabel
pub use join_parameter::{JoinParameter, JoinType};

/// Window operation parameters
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum WindowOperationParameter {
Aggregate(AggregateParameter),
Join(JoinParameter),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::expr_resolver::{AggrExprLabel, ValueExprLabel};

/// [GROUP BY c1, c2, c3...]
#[derive(Clone, PartialEq, Debug, Default, new)]
#[derive(Clone, PartialEq, Eq, Debug, Default, new)]
pub struct GroupByLabels(
/// Empty when GROUP BY clause is not supplied.
Vec<ValueExprLabel>,
Expand All @@ -22,7 +22,7 @@ impl GroupByLabels {
/// [GROUP BY group_by]
/// SLIDING WINDOW ...;
/// ```
#[derive(Clone, PartialEq, Debug, new)]
#[derive(Clone, PartialEq, Eq, Debug, new)]
pub struct AggregateParameter {
// TODO multiple aggr_expr
pub aggr_func: AggregateFunctionParameter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{expr_resolver::ValueExprLabel, pipeline::field::ColumnReference};
/// ON s.c1 = t.c1
/// SLIDING WINDOW ...;
/// ```
#[derive(Clone, PartialEq, Debug, new)]
#[derive(Clone, PartialEq, Eq, Debug, new)]
pub struct JoinParameter {
pub join_type: JoinType,

Expand Down
2 changes: 1 addition & 1 deletion springql-core/src/sql_processor/sql_parser/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum FromItemSyntax {
},
}

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct SubFromItemSyntax {
pub stream_name: StreamName,
pub alias: Option<CorrelationAlias>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ impl WebConsoleRequest {
let tasks = metrics
.get_tasks()
.iter()
.map(|(id, metrics)| TaskRequest::from_metrics(id, &*metrics))
.map(|(id, metrics)| TaskRequest::from_metrics(id, metrics))
.collect();

let queues = metrics
.get_row_queues()
.iter()
.map(|(id, metrics)| QueueRequest::from_row(id, &*metrics, graph))
.map(|(id, metrics)| QueueRequest::from_row(id, metrics, graph))
.chain(
metrics
.get_window_queues()
.iter()
.map(|(id, metrics)| QueueRequest::from_window(id, &*metrics, graph)),
.map(|(id, metrics)| QueueRequest::from_window(id, metrics, graph)),
)
.collect();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
pipeline::{JoinParameter, StreamName, WindowOperationParameter, WindowParameter},
};

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct UpperOps {
pub projection: ProjectionOp,
pub group_aggr_window: Option<GroupAggregateWindowOp>,
Expand All @@ -16,7 +16,7 @@ impl UpperOps {
}
}

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct LowerOps {
pub join: JoinOp,
}
Expand All @@ -26,30 +26,30 @@ impl LowerOps {
}
}

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct ProjectionOp {
pub expr_labels: Vec<ExprLabel>,
}

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct GroupAggregateWindowOp {
pub window_param: WindowParameter,
pub op_param: WindowOperationParameter,
}

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct CollectOp {
pub stream: StreamName,
}

/// TODO recursive join
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum JoinOp {
Collect(CollectOp),
JoinWindow(JoinWindowOp),
}

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct JoinWindowOp {
pub left: CollectOp,
pub right: CollectOp,
Expand Down
6 changes: 3 additions & 3 deletions springql/tests/test_support/request_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct TaskRequest {
pub avg_gain_bytes_per_sec: f32,
}

#[derive(Clone, PartialEq, Debug, Deserialize)]
#[derive(Clone, PartialEq, Eq, Debug, Deserialize)]
pub struct QueueRequest {
pub id: String,
#[serde(rename = "upstream-task-id")]
Expand All @@ -31,15 +31,15 @@ pub struct QueueRequest {
pub window_queue: Option<WindowQueueRequest>,
}

#[derive(Clone, PartialEq, Debug, Deserialize)]
#[derive(Clone, PartialEq, Eq, Debug, Deserialize)]
pub struct RowQueueRequest {
#[serde(rename = "num-rows")]
pub num_rows: u64,
#[serde(rename = "total-bytes")]
pub total_bytes: u64,
}

#[derive(Clone, PartialEq, Debug, Deserialize)]
#[derive(Clone, PartialEq, Eq, Debug, Deserialize)]
pub struct WindowQueueRequest {
#[serde(rename = "num-rows-waiting")]
pub num_rows_waiting: u64,
Expand Down

0 comments on commit 92abd52

Please sign in to comment.