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

Method encode_schema

arrow-flight/src/encode.rs:348–367  ·  view source on GitHub ↗

Encodes schema as a [`FlightData`] in self.queue. Updates `self.schema` and returns the new schema

(&mut self, schema: &SchemaRef)

Source from the content-addressed store, hash-verified

346 /// Encodes schema as a [`FlightData`] in self.queue.
347 /// Updates `self.schema` and returns the new schema
348 fn encode_schema(&mut self, schema: &SchemaRef) -> SchemaRef {
349 // The first message is the schema message, and all
350 // batches have the same schema
351 let send_dictionaries = self.dictionary_handling == DictionaryHandling::Resend;
352 let schema = Arc::new(prepare_schema_for_flight(
353 schema,
354 &mut self.encoder.dictionary_tracker,
355 send_dictionaries,
356 ));
357 let mut schema_flight_data = self.encoder.encode_schema(&schema);
358
359 // attach any metadata requested
360 if let Some(app_metadata) = self.app_metadata.take() {
361 schema_flight_data.app_metadata = app_metadata;
362 }
363 self.queue_message(schema_flight_data);
364 // remember schema
365 self.schema = Some(schema.clone());
366 schema
367 }
368
369 /// Encodes batch into one or more `FlightData` messages in self.queue
370 fn encode_batch(&mut self, batch: RecordBatch) -> Result<()> {

Callers 2

newMethod · 0.80
encode_batchMethod · 0.80

Calls 4

queue_messageMethod · 0.80
takeMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected