(
rb: *const paimon_read_builder,
)
| 215 | /// `rb` must be a valid pointer from `paimon_table_new_read_builder`, or null (returns error). |
| 216 | #[no_mangle] |
| 217 | pub 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 |
nothing calls this directly
no test coverage detected