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

Function paimon_read_builder_new_read

bindings/c/src/table.rs:217–257  ·  view source on GitHub ↗
(
    rb: *const paimon_read_builder,
)

Source from the content-addressed store, hash-verified

215/// `rb` must be a valid pointer from `paimon_table_new_read_builder`, or null (returns error).
216#[no_mangle]
217pub unsafe extern "C" fn paimon_read_builder_new_read(
218 rb: *const paimon_read_builder,
219) -> paimon_result_new_read {
220 if let Err(e) = check_non_null(rb, "rb") {
221 return paimon_result_new_read {
222 read: std::ptr::null_mut(),
223 error: e,
224 };
225 }
226 let state = &*((*rb).inner as *const ReadBuilderState);
227 let mut rb_rust = state.table.new_read_builder();
228
229 // Apply projection if set
230 if let Some(ref columns) = state.projected_columns {
231 let col_refs: Vec<&str> = columns.iter().map(|s| s.as_str()).collect();
232 rb_rust.with_projection(&col_refs);
233 }
234
235 // Apply filter if set
236 if let Some(ref filter) = state.filter {
237 rb_rust.with_filter(filter.clone());
238 }
239
240 match rb_rust.new_read() {
241 Ok(table_read) => {
242 let read_state = TableReadState {
243 table: state.table.clone(),
244 read_type: table_read.read_type().to_vec(),
245 data_predicates: table_read.data_predicates().to_vec(),
246 };
247 paimon_result_new_read {
248 read: box_table_read_state(read_state),
249 error: std::ptr::null_mut(),
250 }
251 }
252 Err(e) => paimon_result_new_read {
253 read: std::ptr::null_mut(),
254 error: paimon_error::from_paimon(e),
255 },
256 }
257}
258
259// ======================= TableScan ===============================
260

Callers

nothing calls this directly

Calls 10

check_non_nullFunction · 0.85
box_table_read_stateFunction · 0.85
new_read_builderMethod · 0.80
with_projectionMethod · 0.80
new_readMethod · 0.80
to_vecMethod · 0.80
read_typeMethod · 0.80
data_predicatesMethod · 0.80
iterMethod · 0.45
with_filterMethod · 0.45

Tested by

no test coverage detected