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

Method build

arrow-flight/src/sql/metadata/sql_info.rs:355–374  ·  view source on GitHub ↗

Encode the contents of this list according to the [FlightSQL spec] [FlightSQL spec]: https://github.com/apache/arrow/blob/f9324b79bf4fc1ec7e97b32e3cce16e75ef0f5e3/format/FlightSql.proto#L32-L43

(self)

Source from the content-addressed store, hash-verified

353 ///
354 /// [FlightSQL spec]: https://github.com/apache/arrow/blob/f9324b79bf4fc1ec7e97b32e3cce16e75ef0f5e3/format/FlightSql.proto#L32-L43
355 pub fn build(self) -> Result<SqlInfoData> {
356 let mut name_builder = UInt32Builder::new();
357 let mut value_builder = SqlInfoUnionBuilder::new();
358
359 let mut names: Vec<_> = self.infos.keys().cloned().collect();
360 names.sort_unstable();
361
362 for key in names {
363 let (name, value) = self.infos.get_key_value(&key).unwrap();
364 name_builder.append_value(*name);
365 value_builder.append_value(value)?
366 }
367
368 let batch = RecordBatch::try_from_iter(vec![
369 ("info_name", Arc::new(name_builder.finish()) as _),
370 ("value", Arc::new(value_builder.finish()) as _),
371 ])?;
372
373 Ok(SqlInfoData { batch })
374 }
375
376 /// Return the [`Schema`] for a GetSchema RPC call with [`crate::sql::CommandGetSqlInfo`]
377 pub fn schema() -> &'static Schema {

Callers 2

test_sql_infosFunction · 0.45
test_filter_sql_infosFunction · 0.45

Calls 4

collectMethod · 0.80
keysMethod · 0.45
append_valueMethod · 0.45
record_batchMethod · 0.45

Tested by 2

test_sql_infosFunction · 0.36
test_filter_sql_infosFunction · 0.36