Skip to content

Commit 4ebeee5

Browse files
committed
formatting
1 parent ae88a90 commit 4ebeee5

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

rust/datafusion/src/execution/projection.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,23 @@ mod tests {
8989

9090
#[test]
9191
fn project_first_column() {
92-
let schema =
93-
Arc::new(Schema::new(vec![
94-
Field::new("c1", DataType::Utf8, false),
95-
Field::new("c2", DataType::UInt32, false),
96-
Field::new("c3", DataType::Int8, false),
97-
Field::new("c3", DataType::Int16, false),
98-
Field::new("c4", DataType::Int32, false),
99-
Field::new("c5", DataType::Int64, false),
100-
Field::new("c6", DataType::UInt8, false),
101-
Field::new("c7", DataType::UInt16, false),
102-
Field::new("c8", DataType::UInt32, false),
103-
Field::new("c9", DataType::UInt64, false),
104-
Field::new("c10", DataType::Float32, false),
105-
Field::new("c11", DataType::Float64, false),
106-
Field::new("c12", DataType::Utf8, false),
107-
]));
108-
let ds = CsvDataSource::new("test/data/aggregate_test_100.csv", schema.clone(), 1024);
92+
let schema = Arc::new(Schema::new(vec![
93+
Field::new("c1", DataType::Utf8, false),
94+
Field::new("c2", DataType::UInt32, false),
95+
Field::new("c3", DataType::Int8, false),
96+
Field::new("c3", DataType::Int16, false),
97+
Field::new("c4", DataType::Int32, false),
98+
Field::new("c5", DataType::Int64, false),
99+
Field::new("c6", DataType::UInt8, false),
100+
Field::new("c7", DataType::UInt16, false),
101+
Field::new("c8", DataType::UInt32, false),
102+
Field::new("c9", DataType::UInt64, false),
103+
Field::new("c10", DataType::Float32, false),
104+
Field::new("c11", DataType::Float64, false),
105+
Field::new("c12", DataType::Utf8, false),
106+
]));
107+
let ds =
108+
CsvDataSource::new("test/data/aggregate_test_100.csv", schema.clone(), 1024);
109109
let relation = Rc::new(RefCell::new(DataSourceRelation::new(Rc::new(
110110
RefCell::new(ds),
111111
))));

rust/datafusion/tests/sql.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ use datafusion::execution::relation::Relation;
3333
fn csv_query_with_predicate() {
3434
let mut ctx = ExecutionContext::new();
3535
register_aggregate_csv(&mut ctx);
36-
let sql =
37-
"SELECT c1, c12 FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4";
36+
let sql = "SELECT c1, c12 FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4";
3837
let actual = execute(&mut ctx, sql);
39-
let expected= "\"e\"\t0.39144436569161134\n\"d\"\t0.38870280983958583\n".to_string();
38+
let expected = "\"e\"\t0.39144436569161134\n\"d\"\t0.38870280983958583\n".to_string();
4039
assert_eq!(expected, actual);
4140
}
4241

@@ -71,7 +70,7 @@ fn csv_query_cast() {
7170
register_aggregate_csv(&mut ctx);
7271
let sql = "SELECT CAST(c12 AS float) FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4";
7372
let actual = execute(&mut ctx, sql);
74-
let expected= "0.39144436569161134\n0.38870280983958583\n".to_string();
73+
let expected = "0.39144436569161134\n0.38870280983958583\n".to_string();
7574
assert_eq!(expected, actual);
7675
}
7776

@@ -93,10 +92,14 @@ fn aggr_test_schema() -> Arc<Schema> {
9392
]))
9493
}
9594

96-
9795
fn register_aggregate_csv(ctx: &mut ExecutionContext) {
9896
let schema = aggr_test_schema();
99-
register_csv(ctx, "aggregate_test_100", "test/data/aggregate_test_100.csv", &schema);
97+
register_csv(
98+
ctx,
99+
"aggregate_test_100",
100+
"test/data/aggregate_test_100.csv",
101+
&schema,
102+
);
100103
}
101104

102105
fn register_csv(
@@ -148,15 +151,18 @@ fn result_str(results: &Rc<RefCell<Relation>>) -> String {
148151
str.push_str(&format!("{:?}", array.value(row_index)));
149152
}
150153
DataType::UInt16 => {
151-
let array = column.as_any().downcast_ref::<UInt16Array>().unwrap();
154+
let array =
155+
column.as_any().downcast_ref::<UInt16Array>().unwrap();
152156
str.push_str(&format!("{:?}", array.value(row_index)));
153157
}
154158
DataType::UInt32 => {
155-
let array = column.as_any().downcast_ref::<UInt32Array>().unwrap();
159+
let array =
160+
column.as_any().downcast_ref::<UInt32Array>().unwrap();
156161
str.push_str(&format!("{:?}", array.value(row_index)));
157162
}
158163
DataType::UInt64 => {
159-
let array = column.as_any().downcast_ref::<UInt64Array>().unwrap();
164+
let array =
165+
column.as_any().downcast_ref::<UInt64Array>().unwrap();
160166
str.push_str(&format!("{:?}", array.value(row_index)));
161167
}
162168
DataType::Float32 => {

0 commit comments

Comments
 (0)