MCPcopy Create free account
hub / github.com/apache/paimon-rust / paimon_table_scan_plan

Function paimon_table_scan_plan

bindings/c/src/table.rs:280–311  ·  view source on GitHub ↗
(
    scan: *const paimon_table_scan,
)

Source from the content-addressed store, hash-verified

278/// `scan` must be a valid pointer from `paimon_read_builder_new_scan`, or null (returns error).
279#[no_mangle]
280pub 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

Callers

nothing calls this directly

Calls 6

check_non_nullFunction · 0.85
new_read_builderMethod · 0.80
new_scanMethod · 0.80
planMethod · 0.80
runtimeFunction · 0.70
with_filterMethod · 0.45

Tested by

no test coverage detected