Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dev/mvn-build-helper/build-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ if [ ! -f "$cache_libpath" ] || [ "$new_checksum" != "$old_checksum" ]; then
cargo fmt --all -q -- 2>&1

echo "Running cargo clippy..."
# First eliminate unwrap; then enable -D warnings to enforce all default lints.
cargo clippy --all-targets --workspace -- -A warnings -A clippy::all -D clippy::unwrap_used 2>&1
cargo clippy --all-targets --workspace -- -D warnings 2>&1

echo "Building native with [$profile] profile..."
cargo build --profile="$profile" $features_arg --verbose --locked --frozen 2>&1
Expand Down
4 changes: 2 additions & 2 deletions native-engine/auron-jni-bridge/src/jni_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ impl JavaClasses<'static> {
pub fn init(env: &JNIEnv) {
if let Err(err) = JNI_JAVA_CLASSES.get_or_try_init(|| -> Result<_, Box<dyn Error>> {
log::info!("Initializing JavaClasses...");
let env = unsafe { std::mem::transmute::<_, &'static JNIEnv>(env) };
let env = unsafe { std::mem::transmute::<&JNIEnv, &'static JNIEnv>(env) };
let jni_bridge = JniBridge::new(env)?;
let classloader = env
.call_static_method_unchecked(
Expand Down Expand Up @@ -1677,7 +1677,7 @@ fn get_global_ref_jobject<'a>(env: &JNIEnv<'a>, obj: JObject<'a>) -> JniResult<J
// as all global refs to jclass in JavaClasses should never be GC'd during
// the whole jvm lifetime, we put GlobalRef into ManuallyDrop to prevent
// deleting these global refs.
let global_obj = unsafe { std::mem::transmute::<_, JObject<'static>>(global.as_obj()) };
let global_obj = unsafe { std::mem::transmute::<JObject, JObject<'static>>(global.as_obj()) };
let _ = std::mem::ManuallyDrop::new(global);
Ok(global_obj)
}
4 changes: 2 additions & 2 deletions native-engine/auron-planner/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ fn main() -> Result<(), String> {
}
}
if let Some(path) = protoc_file {
eprintln!("Using protoc executable: {:?}", path);
eprintln!("Using protoc executable: {path:?}");
prost_build.protoc_executable(path);
}
prost_build
.compile_protos(&["proto/auron.proto"], &["proto"])
.map_err(|e| format!("protobuf compilation failed: {}", e))
.map_err(|e| format!("protobuf compilation failed: {e}"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -744,10 +744,10 @@ pub mod tests {

#[test]
fn test_bytes() {
test_bytes_impl::<Utf8Type>();
test_bytes_impl::<LargeUtf8Type>();
test_bytes_impl::<BinaryType>();
test_bytes_impl::<LargeBinaryType>();
let _ = test_bytes_impl::<Utf8Type>();
let _ = test_bytes_impl::<LargeUtf8Type>();
let _ = test_bytes_impl::<BinaryType>();
let _ = test_bytes_impl::<LargeBinaryType>();
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions native-engine/datafusion-ext-commons/src/io/batch_serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ mod test {
])?;

assert_batches_eq!(
vec![
[
"+-----------+-----------+",
"| list1 | list2 |",
"+-----------+-----------+",
Expand All @@ -761,7 +761,7 @@ mod test {
let (decoded_num_rows, decoded_cols) =
read_batch(&mut cursor, &batch.schema())?.expect("non-empty batch");
assert_batches_eq!(
vec![
[
"+-----------+-----------+",
"| list1 | list2 |",
"+-----------+-----------+",
Expand All @@ -786,7 +786,7 @@ mod test {
let (decoded_num_rows, decoded_cols) =
read_batch(&mut cursor, &batch.schema())?.expect("non-empty batch");
assert_batches_eq!(
vec![
[
"+----------+----------+",
"| list1 | list2 |",
"+----------+----------+",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ fn io_compression_codec() -> &'static str {
if is_jni_bridge_inited() {
conf::SPARK_IO_COMPRESSION_CODEC.value()
} else {
Ok(format!("lz4")) // for testing
Ok("lz4".to_string()) // for testing
}
})
.expect("error reading spark.io.compression.codec")
Expand Down
10 changes: 5 additions & 5 deletions native-engine/datafusion-ext-commons/src/spark_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,15 @@ mod tests {
let value_data = ArrayData::builder(DataType::Int32)
.len(6)
.add_buffer(Buffer::from_slice_ref(
&[1i32, 2, 3, 4, 5, 6].to_byte_slice(),
[1i32, 2, 3, 4, 5, 6].to_byte_slice(),
))
.build()?;

// Create offset array to define list boundaries: [[1, 2], [3, 4, 5], [6]]
let list_data_type = DataType::new_list(DataType::Int32, false);
let list_data = ArrayData::builder(list_data_type)
.len(3)
.add_buffer(Buffer::from_slice_ref(&[0i32, 2, 5, 6].to_byte_slice()))
.add_buffer(Buffer::from_slice_ref([0i32, 2, 5, 6].to_byte_slice()))
.add_child_data(value_data)
.build()?;

Expand All @@ -550,20 +550,20 @@ mod tests {
let key_data = ArrayData::builder(DataType::Int32)
.len(8)
.add_buffer(Buffer::from_slice_ref(
&[0, 1, 2, 3, 4, 5, 6, 7].to_byte_slice(),
[0, 1, 2, 3, 4, 5, 6, 7].to_byte_slice(),
))
.build()?;
let value_data = ArrayData::builder(DataType::UInt32)
.len(8)
.add_buffer(Buffer::from_slice_ref(
&[0u32, 10, 20, 0, 40, 0, 60, 70].to_byte_slice(),
[0u32, 10, 20, 0, 40, 0, 60, 70].to_byte_slice(),
))
.null_bit_buffer(Some(Buffer::from(&[0b11010110])))
.build()?;

// Construct a buffer for value offsets, for the nested array:
// [[0, 1, 2], [3, 4, 5], [6, 7]]
let entry_offsets = Buffer::from_slice_ref(&[0, 3, 6, 8].to_byte_slice());
let entry_offsets = Buffer::from_slice_ref([0, 3, 6, 8].to_byte_slice());

let keys_field = Arc::new(Field::new("keys", DataType::Int32, false));
let values_field = Arc::new(Field::new("values", DataType::UInt32, true));
Expand Down
Loading