Skip to content
Merged
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
18 changes: 8 additions & 10 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ on:
- "native/core/benches/**"
- "native/spark-expr/benches/**"
- "spark/src/test/scala/org/apache/spark/sql/benchmark/**"
# Disabled until Miri compatibility is restored
# https://github.com/apache/datafusion-comet/issues/3499
# pull_request:
# paths-ignore:
# - "doc/**"
# - "docs/**"
# - "**.md"
# - "native/core/benches/**"
# - "native/spark-expr/benches/**"
# - "spark/src/test/scala/org/apache/spark/sql/benchmark/**"
pull_request:
paths-ignore:
- "doc/**"
- "docs/**"
- "**.md"
- "native/core/benches/**"
- "native/spark-expr/benches/**"
- "spark/src/test/scala/org/apache/spark/sql/benchmark/**"
# manual trigger
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
Expand Down
16 changes: 13 additions & 3 deletions native/core/src/execution/shuffle/spark_unsafe/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,15 @@ impl SparkUnsafeObject for SparkUnsafeRow {
self.row_addr
}

fn get_element_offset(&self, index: usize, _: usize) -> *const u8 {
(self.row_addr + self.row_bitset_width + (index * 8) as i64) as *const u8
fn get_element_offset(&self, index: usize, element_size: usize) -> *const u8 {
let offset = self.row_bitset_width + (index * 8) as i64;
debug_assert!(
self.row_size >= 0 && offset + element_size as i64 <= self.row_size as i64,
"get_element_offset: access at offset {offset} with size {element_size} \
exceeds row_size {} for index {index}",
self.row_size
);
(self.row_addr + offset) as *const u8
}
}

Expand Down Expand Up @@ -1659,7 +1666,10 @@ mod test {
let fields = Fields::from(vec![Field::new("st", data_type.clone(), true)]);
let mut struct_builder = StructBuilder::from_fields(fields, 1);
let mut row = SparkUnsafeRow::new_with_num_fields(1);
let data = [0; 8];
// 8 bytes null bitset + 8 bytes field value = 16 bytes
// Set bit 0 in the null bitset to mark field 0 as null
let mut data = [0u8; 16];
data[0] = 1;
row.point_to_slice(&data);
append_field(&data_type, &mut struct_builder, &row, 0).expect("append field");
struct_builder.append_null();
Expand Down
Loading