This is an automated email from the ASF dual-hosted git repository.
zuston pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/auron.git
The following commit(s) were added to refs/heads/master by this push:
new 20152e1a fix some rust style (#1257)
20152e1a is described below
commit 20152e1a24e8d58bd99cee4dfb899616efa5181a
Author: cxzl25 <[email protected]>
AuthorDate: Tue Sep 2 11:34:07 2025 +0800
fix some rust style (#1257)
---
native-engine/datafusion-ext-commons/src/arrow/cast.rs | 9 +++------
native-engine/datafusion-ext-commons/src/hash/xxhash.rs | 2 +-
native-engine/datafusion-ext-commons/src/spark_hash.rs | 4 ----
3 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/native-engine/datafusion-ext-commons/src/arrow/cast.rs
b/native-engine/datafusion-ext-commons/src/arrow/cast.rs
index 061174eb..e3e7e494 100644
--- a/native-engine/datafusion-ext-commons/src/arrow/cast.rs
+++ b/native-engine/datafusion-ext-commons/src/arrow/cast.rs
@@ -24,11 +24,11 @@ use num::{Bounded, FromPrimitive, Integer, Signed};
use crate::df_execution_err;
pub fn cast(array: &dyn Array, cast_type: &DataType) -> Result<ArrayRef> {
- return cast_impl(array, cast_type, false);
+ cast_impl(array, cast_type, false)
}
pub fn cast_scan_input_array(array: &dyn Array, cast_type: &DataType) ->
Result<ArrayRef> {
- return cast_impl(array, cast_type, true);
+ cast_impl(array, cast_type, true)
}
pub fn cast_impl(
@@ -418,10 +418,7 @@ fn to_date(s: &str) -> Option<i32> {
}
let local_date =
chrono::NaiveDate::from_ymd_opt(sign * segments[0], segments[1] as
u32, segments[2] as u32);
- match local_date {
- Some(local_date) => Some(local_date.num_days_from_ce() - 719163),
- None => None,
- }
+ local_date.map(|local_date| local_date.num_days_from_ce() - 719163)
}
#[cfg(test)]
diff --git a/native-engine/datafusion-ext-commons/src/hash/xxhash.rs
b/native-engine/datafusion-ext-commons/src/hash/xxhash.rs
index a9078f8c..a0fa967f 100644
--- a/native-engine/datafusion-ext-commons/src/hash/xxhash.rs
+++ b/native-engine/datafusion-ext-commons/src/hash/xxhash.rs
@@ -116,7 +116,7 @@ fn xxh64_avalanche(mut hash: u64) -> u64 {
hash ^= hash >> 29;
hash *= PRIME64_3;
hash ^= hash >> 32;
- return hash;
+ hash
}
#[cfg(test)]
diff --git a/native-engine/datafusion-ext-commons/src/spark_hash.rs
b/native-engine/datafusion-ext-commons/src/spark_hash.rs
index 43601486..323f2ac8 100644
--- a/native-engine/datafusion-ext-commons/src/spark_hash.rs
+++ b/native-engine/datafusion-ext-commons/src/spark_hash.rs
@@ -64,10 +64,6 @@ fn hash_array<T: num::PrimInt>(
) {
assert_eq!(array.len(), hashes_buffer.len());
- macro_rules! initial_seed_or {
- ($h:expr) => {{ if is_initial { initial_seed } else { $h } }};
- }
-
macro_rules! hash_array {
($array_type:ident, $column:ident, $hashes:ident, $h:expr) => {
let array =
$column.as_any().downcast_ref::<$array_type>().unwrap();