-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Constructing a schema with duplicate identical qualified names does not produce an error. I think it should, or we should extend the documentation of DFSchema::check_names
to explain why those are allowed and where they are needed.
To Reproduce
use arrow_schema::{DataType, Field};
use datafusion_common::DFSchema;
use datafusion_sql::TableReference;
use std::sync::Arc;
#[test]
fn df_schema_check() {
let t = || TableReference::bare("t");
let schema = DFSchema::new_with_metadata(
vec![
(Some(t()), Arc::new(Field::new("a", DataType::Int64, true))),
(Some(t()), Arc::new(Field::new("a", DataType::Utf8, false))),
],
Default::default(),
);
schema.expect_err("duplicate t.a columns");
}
Expected behavior
Reading through the comments, I would expect to see an error thrown by the join
method in this case.
Additional context
I found this while working on #11456.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working