You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Rust][DataFusion] Join Statement: Schema contains duplicate unqualified field name #9307
"Schema contains duplicate unqualified field name \'a\'")
thread 'tests::simple_join' panicked at 'assertion failed: `(left == right)` left: `1`, right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure'
let schema1 = Arc::new(Schema::new(vec![Field::new("a",DataType::Utf8,false),Field::new("b",DataType::Int32,false),]));let schema2 = Arc::new(Schema::new(vec![Field::new("a",DataType::Utf8,false),Field::new("d",DataType::Int32,false),]));// define data.let batch1 = RecordBatch::try_new(
schema1.clone(),vec![Arc::new(StringArray::from(vec!["a","b","c","d"])),Arc::new(Int32Array::from(vec![1,10,10,100])),],)?;// define data.let batch2 = RecordBatch::try_new(
schema2.clone(),vec![Arc::new(StringArray::from(vec!["a","b","c","d"])),Arc::new(Int32Array::from(vec![1,10,10,100])),],)?;letmut ctx = ExecutionContext::new();let table1 = MemTable::try_new(schema1,vec![vec![batch1]])?;let table2 = MemTable::try_new(schema2,vec![vec![batch2]])?;
ctx.register_table("t1",Box::new(table1));
ctx.register_table("t2",Box::new(table2));let sql = concat!("SELECT a, b, d ","FROM t1 JOIN t2 ON t1.a = t2.a ","ORDER BY b ASC ","LIMIT 3");let plan = ctx.create_logical_plan(&sql)?;let plan = ctx.optimize(&plan)?;let plan = ctx.create_physical_plan(&plan)?;
let sql = concat!("SELECT b, d ","FROM t1 JOIN t2 ON t1.a = t2.a ","ORDER BY b ASC ","LIMIT 3");let sql = concat!("SELECT t1.a as a, b, d ","FROM t1 JOIN t2 ON t1.a = t2.a ","ORDER BY b ASC ","LIMIT 3");
But I still got the same error.
Schema contains duplicate unqualified field name \'a\'")thread 'tests::simple_join' panicked at 'assertion failed: `(left == right)` left: `1`, right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure'
Activity
Dandandan commentedon Jan 24, 2021
@gangliao I believe this is a SQL error, the
ais ambiguous in the projection. Could you try:SELECT t1.a as a, b, d?gangliao commentedon Jan 24, 2021
I tried two solutions:
But I still got the same error.
jorgecarleitao commentedon Jan 29, 2021
Seems like a bug to me. :( Could you add it to JIRA?
gangliao commentedon Jan 29, 2021
Sure.
emkornfield commentedon Jan 30, 2021
going to close this issue for now.