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

Function paimon_read_builder_with_projection

bindings/c/src/table.rs:122–154  ·  view source on GitHub ↗
(
    rb: *mut paimon_read_builder,
    columns: *const *const std::ffi::c_char,
)

Source from the content-addressed store, hash-verified

120/// `columns` must be a null-terminated array of null-terminated C strings, or null for no projection.
121#[no_mangle]
122pub unsafe extern "C" fn paimon_read_builder_with_projection(
123 rb: *mut paimon_read_builder,
124 columns: *const *const std::ffi::c_char,
125) -> *mut paimon_error {
126 if let Err(e) = check_non_null(rb, "rb") {
127 return e;
128 }
129
130 let state = &mut *((*rb).inner as *mut ReadBuilderState);
131
132 if columns.is_null() {
133 state.projected_columns = None;
134 return std::ptr::null_mut();
135 }
136
137 let mut col_names = Vec::new();
138 let mut ptr = columns;
139 while !(*ptr).is_null() {
140 let c_str = std::ffi::CStr::from_ptr(*ptr);
141 match c_str.to_str() {
142 Ok(s) => col_names.push(s.to_string()),
143 Err(e) => {
144 return paimon_error::from_paimon(paimon::Error::ConfigInvalid {
145 message: format!("Invalid UTF-8 in column name: {e}"),
146 });
147 }
148 }
149 ptr = ptr.add(1);
150 }
151
152 state.projected_columns = Some(col_names);
153 std::ptr::null_mut()
154}
155
156/// Set a filter predicate for scan planning.
157///

Callers

nothing calls this directly

Calls 3

check_non_nullFunction · 0.85
is_nullMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected