Skip to content

Commit 3b71d3c

Browse files
committed
format
1 parent 4d2f89d commit 3b71d3c

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

native/spark-expr/benches/to_time.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,20 @@ fn criterion_benchmark(c: &mut Criterion) {
2929
b.iter(|| spark_to_time(std::slice::from_ref(&hh_mm), true).unwrap());
3030
});
3131

32-
let hh_mm_ss = create_string_array(10000, |i| {
33-
format!("{}:{:02}:{:02}", i % 24, i % 60, i % 60)
34-
});
32+
let hh_mm_ss =
33+
create_string_array(10000, |i| format!("{}:{:02}:{:02}", i % 24, i % 60, i % 60));
3534
group.bench_function("hh_mm_ss", |b| {
3635
b.iter(|| spark_to_time(std::slice::from_ref(&hh_mm_ss), true).unwrap());
3736
});
3837

3938
let fractional = create_string_array(10000, |i| {
40-
format!("{}:{:02}:{:02}.{:06}", i % 24, i % 60, i % 60, i * 7 % 1000000)
39+
format!(
40+
"{}:{:02}:{:02}.{:06}",
41+
i % 24,
42+
i % 60,
43+
i % 60,
44+
i * 7 % 1000000
45+
)
4146
});
4247
group.bench_function("fractional", |b| {
4348
b.iter(|| spark_to_time(std::slice::from_ref(&fractional), true).unwrap());

native/spark-expr/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ pub use comet_scalar_funcs::{
7373
};
7474
pub use csv_funcs::*;
7575
pub use datetime_funcs::{
76-
spark_to_time, SparkDateDiff, SparkDateFromUnixDate, SparkDateTrunc,
77-
SparkHour, SparkHoursTransform, SparkMakeDate, SparkMakeTime, SparkMinute, SparkSecond,
76+
spark_to_time, SparkDateDiff, SparkDateFromUnixDate, SparkDateTrunc, SparkHour,
77+
SparkHoursTransform, SparkMakeDate, SparkMakeTime, SparkMinute, SparkSecond,
7878
SparkSecondsToTimestamp, SparkUnixTimestamp, TimestampTruncExpr,
7979
};
8080
pub use error::{decimal_overflow_error, SparkError, SparkErrorWithContext, SparkResult};

0 commit comments

Comments
 (0)