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

Method find_qualified_columns

datafusion/core/src/dataframe/mod.rs:2538–2551  ·  view source on GitHub ↗

Find qualified columns for this dataframe from names # Arguments `names` - Unqualified names to find. # Example ``` # use datafusion::prelude::*; # use datafusion::error::Result; # use datafusion_common::ScalarValue; # #[tokio::main] # async fn main() -> Result<()> { let ctx = SessionContext::new(); ctx.register_csv("first_table", "tests/data/example.csv", CsvReadOptions::new()) .await?; let df

(
        &self,
        names: &[&str],
    )

Source from the content-addressed store, hash-verified

2536 /// # }
2537 /// ```
2538 pub fn find_qualified_columns(
2539 &self,
2540 names: &[&str],
2541 ) -> Result<Vec<(Option<&TableReference>, &FieldRef)>> {
2542 let schema = self.logical_plan().schema();
2543 names
2544 .iter()
2545 .map(|name| {
2546 schema
2547 .qualified_field_from_column(&Column::from_name(*name))
2548 .map_err(|_| plan_datafusion_err!("Column '{}' not found", name))
2549 })
2550 .collect()
2551 }
2552
2553 /// Helper for creating DataFrame.
2554 /// # Example

Calls 6

collectMethod · 0.80
schemaMethod · 0.45
logical_planMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45

Tested by 2