(
scan: *const paimon_table_scan,
)
| 278 | /// `scan` must be a valid pointer from `paimon_read_builder_new_scan`, or null (returns error). |
| 279 | #[no_mangle] |
| 280 | pub unsafe extern "C" fn paimon_table_scan_plan( |
| 281 | scan: *const paimon_table_scan, |
| 282 | ) -> paimon_result_plan { |
| 283 | if let Err(e) = check_non_null(scan, "scan") { |
| 284 | return paimon_result_plan { |
| 285 | plan: std::ptr::null_mut(), |
| 286 | error: e, |
| 287 | }; |
| 288 | } |
| 289 | let scan_state = &*((*scan).inner as *const TableScanState); |
| 290 | let mut rb = scan_state.table.new_read_builder(); |
| 291 | if let Some(ref filter) = scan_state.filter { |
| 292 | rb.with_filter(filter.clone()); |
| 293 | } |
| 294 | let table_scan = rb.new_scan(); |
| 295 | |
| 296 | match runtime().block_on(table_scan.plan()) { |
| 297 | Ok(plan) => { |
| 298 | let wrapper = Box::new(paimon_plan { |
| 299 | inner: Box::into_raw(Box::new(plan)) as *mut c_void, |
| 300 | }); |
| 301 | paimon_result_plan { |
| 302 | plan: Box::into_raw(wrapper), |
| 303 | error: std::ptr::null_mut(), |
| 304 | } |
| 305 | } |
| 306 | Err(e) => paimon_result_plan { |
| 307 | plan: std::ptr::null_mut(), |
| 308 | error: paimon_error::from_paimon(e), |
| 309 | }, |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | // ======================= Plan =============================== |
| 314 |
nothing calls this directly
no test coverage detected