MCPcopy Create free account
hub / github.com/apache/arrow-rs / get_schema

Method get_schema

arrow-array/src/ffi_stream.rs:216–235  ·  view source on GitHub ↗
(&mut self, out: *mut FFI_ArrowSchema)

Source from the content-addressed store, hash-verified

214 }
215
216 pub fn get_schema(&mut self, out: *mut FFI_ArrowSchema) -> i32 {
217 let private_data = self.get_private_data();
218 let reader = &private_data.batch_reader;
219
220 let schema = FFI_ArrowSchema::try_from(reader.schema().as_ref());
221
222 match schema {
223 Ok(schema) => {
224 unsafe { std::ptr::copy(addr_of!(schema), out, 1) };
225 std::mem::forget(schema);
226 0
227 }
228 Err(ref err) => {
229 private_data.last_error = Some(
230 CString::new(err.to_string()).expect("Error string has a null byte in it."),
231 );
232 get_error_code(err)
233 }
234 }
235 }
236
237 pub fn get_next(&mut self, out: *mut FFI_ArrowArray) -> i32 {
238 let private_data = self.get_private_data();

Callers 1

get_schemaFunction · 0.45

Calls 4

get_error_codeFunction · 0.85
get_private_dataMethod · 0.80
as_refMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected