MCPcopy Create free account
hub / github.com/apache/datafusion / push_with_metadata

Method push_with_metadata

datafusion/expr/src/logical_plan/builder.rs:1574–1588  ·  view source on GitHub ↗
(
        &mut self,
        data_type: DataType,
        nullable: bool,
        metadata: Option<FieldMetadata>,
    )

Source from the content-addressed store, hash-verified

1572 }
1573
1574 pub fn push_with_metadata(
1575 &mut self,
1576 data_type: DataType,
1577 nullable: bool,
1578 metadata: Option<FieldMetadata>,
1579 ) {
1580 // Naming follows the convention described here:
1581 // https://www.postgresql.org/docs/current/queries-values.html
1582 let name = format!("column{}", self.inner.len() + 1);
1583 let mut field = Field::new(name, data_type, nullable);
1584 if let Some(metadata) = metadata {
1585 field.set_metadata(metadata.to_hashmap());
1586 }
1587 self.inner.push(field);
1588 }
1589
1590 pub fn into_fields(self) -> Fields {
1591 self.inner.into()

Callers 2

infer_dataMethod · 0.80
pushMethod · 0.80

Calls 3

newFunction · 0.85
to_hashmapMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected