Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c598166
checkpoint - initial phase1
scovich Aug 22, 2025
3012d1d
checkpoint - phase1 refined
scovich Aug 22, 2025
141ae80
checkpoint - phase 1.5 initial
scovich Aug 22, 2025
857c0ba
checkpoint - phase2 initial
scovich Aug 22, 2025
2a96ec3
checkpoint - phase2 fix
scovich Aug 22, 2025
06b1518
checkpoint - phase2 complete
scovich Aug 22, 2025
b839eb6
fmt
scovich Aug 22, 2025
0e560a8
checkpoint phase3 complete
scovich Aug 22, 2025
0e10d6b
checkpoint - use sparse transforms - initial
scovich Aug 23, 2025
b42a7af
manual cleanup - compiles cleanly
scovich Aug 23, 2025
3473687
checkpoint - fix column mapping
scovich Aug 23, 2025
a5c11d2
checkpoint - remove incorrect validation
scovich Aug 23, 2025
454f3d1
checkpoint - short circuit
scovich Aug 23, 2025
22289f5
fmt
scovich Aug 23, 2025
6f651c1
cleanups
scovich Aug 25, 2025
11761fa
self review
scovich Aug 25, 2025
ffeb490
Merge remote-tracking branch 'oss/main' into sparse-expressions
scovich Aug 25, 2025
b57d632
Fix nested pathing bug
scovich Aug 25, 2025
dd4926c
identity transform shortcut must be path-aware
scovich Aug 25, 2025
0823b92
checkpoint
scovich Aug 25, 2025
22fd71e
checkpoint
scovich Aug 25, 2025
20f2cc4
checkpoint
scovich Aug 25, 2025
6a944d3
checkpoint
scovich Aug 26, 2025
419f714
checkpoint
scovich Aug 26, 2025
e1f8a16
pathing bug fixed, tests cover it now
scovich Aug 26, 2025
64527df
review comments
scovich Aug 26, 2025
28a3f84
probe the transform insertion map with borrowed keys
scovich Aug 26, 2025
62d2488
more cleanups; add drop field transform spec
scovich Aug 26, 2025
8eade9a
review feedback
scovich Aug 26, 2025
0f6b72c
use struct enum variants for FieldTransformSpec
scovich Aug 26, 2025
86f0b39
Merge branch 'main' into sparse-expressions
scovich Aug 26, 2025
bd84add
Merge branch 'main' into sparse-expressions
scovich Aug 27, 2025
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
5 changes: 5 additions & 0 deletions ffi/src/expressions/engine_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ fn visit_expression_impl(
Expression::Opaque(OpaqueExpression { op, exprs }) => {
visit_expression_opaque(visitor, op, exprs, sibling_list_id)
}
Expression::Transform(_) => {
// Minimal FFI support: Transform expressions are treated as unknown
// TODO: Implement full Transform FFI support in future version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

started #1205

visit_unknown(visitor, sibling_list_id, "Transform")
}
Expression::Unknown(name) => visit_unknown(visitor, sibling_list_id, name),
}
}
Expand Down
56 changes: 56 additions & 0 deletions kernel/src/engine/arrow_expression/apply_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,59 @@ pub(crate) fn apply_schema_to(array: &ArrayRef, schema: &DataType) -> DeltaResul
};
Ok(array)
}

#[cfg(test)]
mod apply_schema_validation_tests {
use super::*;

use std::sync::Arc;

use crate::arrow::array::{Int32Array, StructArray};
use crate::arrow::datatypes::{
DataType as ArrowDataType, Field as ArrowField, Schema as ArrowSchema,
};
use crate::schema::{DataType, StructField, StructType};

#[test]
fn test_apply_schema_basic_functionality() {
// Test that apply_schema works for basic field transformation
let input_array = create_test_struct_array_2_fields();
let target_schema = create_target_schema_2_fields();

// This should succeed - basic schema application
let result = apply_schema_to_struct(&input_array, &target_schema);
assert!(result.is_ok(), "Basic schema application should succeed");

let result_array = result.unwrap();
assert_eq!(
result_array.len(),
input_array.len(),
"Row count should be preserved"
);
assert_eq!(result_array.num_columns(), 2, "Should have 2 columns");
}

// Helper functions to create test data
fn create_test_struct_array_2_fields() -> StructArray {
let field1 = ArrowField::new("a", ArrowDataType::Int32, false);
let field2 = ArrowField::new("b", ArrowDataType::Int32, false);
let schema = ArrowSchema::new(vec![field1, field2]);

let a_data = Int32Array::from(vec![1, 2, 3]);
let b_data = Int32Array::from(vec![4, 5, 6]);

StructArray::try_new(
schema.fields.clone(),
vec![Arc::new(a_data), Arc::new(b_data)],
None,
)
.unwrap()
}

fn create_target_schema_2_fields() -> StructType {
StructType::new([
StructField::new("a", DataType::INTEGER, false),
StructField::new("b", DataType::INTEGER, false),
])
}
}
Loading
Loading