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

Function test_find_qualified_names

datafusion/core/tests/dataframe/mod.rs:611–653  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

609
610#[tokio::test]
611async fn test_find_qualified_names() -> Result<()> {
612 let t = test_table().await?;
613 let column_names = ["c1", "c2", "c3"];
614 let columns = t.find_qualified_columns(&column_names)?;
615
616 // Expected results for each column
617 let binding = TableReference::bare("aggregate_test_100");
618 let expected = [
619 (Some(&binding), "c1"),
620 (Some(&binding), "c2"),
621 (Some(&binding), "c3"),
622 ];
623
624 // Verify we got the expected number of results
625 assert_eq!(
626 columns.len(),
627 expected.len(),
628 "Expected {} columns, got {}",
629 expected.len(),
630 columns.len()
631 );
632
633 // Iterate over the results and check each one individually
634 for (i, (actual, expected)) in columns.iter().zip(expected.iter()).enumerate() {
635 let (actual_table_ref, actual_field_ref) = actual;
636 let (expected_table_ref, expected_field_name) = expected;
637
638 // Check table reference
639 assert_eq!(
640 actual_table_ref, expected_table_ref,
641 "Column {i}: expected table reference {expected_table_ref:?}, got {actual_table_ref:?}"
642 );
643
644 // Check field name
645 assert_eq!(
646 actual_field_ref.name(),
647 *expected_field_name,
648 "Column {i}: expected field name '{expected_field_name}', got '{actual_field_ref}'"
649 );
650 }
651
652 Ok(())
653}
654
655#[tokio::test]
656async fn drop_with_quotes() -> Result<()> {

Callers

nothing calls this directly

Calls 3

test_tableFunction · 0.85
iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…