Skip to content

Commit 7f7ad74

Browse files
authored
chore: Move spark unsafe classes into spark_unsafe (#3373)
1 parent fab8009 commit 7f7ad74

7 files changed

Lines changed: 31 additions & 11 deletions

File tree

native/core/benches/row_columnar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use arrow::datatypes::DataType as ArrowDataType;
19-
use comet::execution::shuffle::row::{
19+
use comet::execution::shuffle::spark_unsafe::row::{
2020
process_sorted_row_partition, SparkUnsafeObject, SparkUnsafeRow,
2121
};
2222
use comet::execution::shuffle::CompressionCodec;

native/core/src/execution/jni_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::{
2222
errors::{try_unwrap_or_throw, CometError, CometResult},
2323
execution::{
2424
metrics::utils::update_comet_metric, planner::PhysicalPlanner, serde::to_arrow_datatype,
25-
shuffle::row::process_sorted_row_partition, sort::RdxSort,
25+
shuffle::spark_unsafe::row::process_sorted_row_partition, sort::RdxSort,
2626
},
2727
jvm_bridge::{jni_new_global_ref, JVMClasses},
2828
};

native/core/src/execution/shuffle/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717

1818
pub(crate) mod codec;
1919
mod comet_partitioning;
20-
mod list;
21-
mod map;
22-
pub mod row;
2320
mod shuffle_writer;
21+
pub mod spark_unsafe;
2422

2523
pub use codec::{read_ipc_compressed, CompressionCodec, ShuffleBlockWriter};
2624
pub use comet_partitioning::CometPartitioning;

native/core/src/execution/shuffle/list.rs renamed to native/core/src/execution/shuffle/spark_unsafe/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use crate::{
1919
errors::CometError,
20-
execution::shuffle::{
20+
execution::shuffle::spark_unsafe::{
2121
map::append_map_elements,
2222
row::{append_field, downcast_builder_ref, SparkUnsafeObject, SparkUnsafeRow},
2323
},

native/core/src/execution/shuffle/map.rs renamed to native/core/src/execution/shuffle/spark_unsafe/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use crate::{
1919
errors::CometError,
20-
execution::shuffle::list::{append_to_builder, SparkUnsafeArray},
20+
execution::shuffle::spark_unsafe::list::{append_to_builder, SparkUnsafeArray},
2121
};
2222
use arrow::array::builder::{ArrayBuilder, MapBuilder, MapFieldNames};
2323
use arrow::datatypes::{DataType, FieldRef};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
mod list;
19+
mod map;
20+
pub mod row;

native/core/src/execution/shuffle/row.rs renamed to native/core/src/execution/shuffle/spark_unsafe/row.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ use crate::{
2222
execution::{
2323
shuffle::{
2424
codec::{Checksum, ShuffleBlockWriter},
25-
list::{append_list_element, SparkUnsafeArray},
26-
map::{append_map_elements, get_map_key_value_fields, SparkUnsafeMap},
25+
spark_unsafe::{
26+
list::{append_list_element, SparkUnsafeArray},
27+
map::{append_map_elements, get_map_key_value_fields, SparkUnsafeMap},
28+
},
2729
},
2830
utils::bytes_to_i128,
2931
},
@@ -293,7 +295,7 @@ pub(crate) use downcast_builder_ref;
293295
/// `struct_builder.append` is called before/after calling this function to append the null buffer
294296
/// of the struct array.
295297
#[allow(clippy::redundant_closure_call)]
296-
pub(crate) fn append_field(
298+
pub(super) fn append_field(
297299
dt: &DataType,
298300
struct_builder: &mut StructBuilder,
299301
row: &SparkUnsafeRow,
@@ -441,7 +443,7 @@ pub(crate) fn append_field(
441443

442444
/// Appends column of top rows to the given array builder.
443445
#[allow(clippy::redundant_closure_call, clippy::too_many_arguments)]
444-
pub(crate) fn append_columns(
446+
fn append_columns(
445447
row_addresses_ptr: *mut jlong,
446448
row_sizes_ptr: *mut jint,
447449
row_start: usize,

0 commit comments

Comments
 (0)