gangliao opened a new issue #9307:
URL: https://github.com/apache/arrow/issues/9307
```shell
"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'
```
```rust
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])),
],
)?;
let mut 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)?;
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]