Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia committed Nov 22, 2023
1 parent ba32e1b commit 7b8f57c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/metric-engine/src/engine/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl MetricEngineInner {
) -> Result<ScanRequest> {
// transform projection
let physical_projection = if let Some(projection) = &request.projection {
self.transform_projection(physical_region_id, logical_region_id, &projection)
self.transform_projection(physical_region_id, logical_region_id, projection)
.await?
} else {
self.default_projection(physical_region_id, logical_region_id)
Expand Down Expand Up @@ -215,6 +215,7 @@ mod test {
.await
.unwrap();

// check explicit projection
let mut scan_req = ScanRequest::default();
scan_req.projection = Some(vec![0, 1, 2, 3, 4, 5, 6]);
scan_req.filters = vec![];
Expand All @@ -234,5 +235,15 @@ mod test {
.eq(logical_expr::lit(logical_region_id.table_id()))
.into()
);

// check default projection
let mut scan_req = ScanRequest::default();
let scan_req = env
.metric()
.inner
.transform_request(physical_region_id, logical_region_id, scan_req)
.await
.unwrap();
assert_eq!(scan_req.projection.unwrap(), vec![0, 1, 4, 7, 8, 9, 10]);
}
}
2 changes: 1 addition & 1 deletion src/metric-engine/src/engine/region_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl MetricEngineInner {
.filter_map(|mut col| {
// recover the semantic type of logical columns
if logical_column_set.contains_key(&col.column_schema.name) {
col.semantic_type = logical_column_set[&col.column_schema.name].clone();
col.semantic_type = logical_column_set[&col.column_schema.name];
Some(col)
} else {
None
Expand Down

0 comments on commit 7b8f57c

Please sign in to comment.