martin-g commented on code in PR #18672:
URL: https://github.com/apache/datafusion/pull/18672#discussion_r2548824826
##########
datafusion/ffi/src/plan_properties.rs:
##########
@@ -314,19 +318,43 @@ mod tests {
let _ = eqp.reorder([PhysicalSortExpr::new_default(
datafusion::physical_plan::expressions::col("a", &schema)?,
)]);
- let original_props = PlanProperties::new(
+ Ok(PlanProperties::new(
eqp,
Partitioning::RoundRobinBatch(3),
EmissionType::Incremental,
Boundedness::Bounded,
- );
+ ))
+ }
- let local_props_ptr = FFI_PlanProperties::from(&original_props);
+ #[test]
+ fn test_round_trip_ffi_plan_properties() -> Result<()> {
+ let original_props = create_test_props()?;
+ let mut local_props_ptr = FFI_PlanProperties::from(&original_props);
+ local_props_ptr.library_marker_id = crate::mock_foreign_marker_id;
let foreign_props: PlanProperties = local_props_ptr.try_into()?;
assert_eq!(format!("{foreign_props:?}"),
format!("{original_props:?}"));
Ok(())
}
+
+ #[test]
+ fn test_ffi_execution_plan_local_bypass() -> Result<()> {
+ let props = create_test_props()?;
+
+ let ffi_plan = FFI_PlanProperties::from(&props);
+
+ // Verify local libraries
+ let foreign_plan: PlanProperties = ffi_plan.try_into()?;
+ assert_eq!(format!("{foreign_plan:?}"), format!("{:?}", foreign_plan));
Review Comment:
comparing with itself
```suggestion
assert_eq!(format!("{foreign_plan:?}"), format!("{props:?}"));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]