andygrove opened a new issue, #2372:
URL: https://github.com/apache/arrow-datafusion/issues/2372

   **Describe the bug**
   See the test case below
   
   **To Reproduce**
   ``` rust
   #[tokio::test]
   async fn query_cte_with_alias() -> Result<()> {
       let ctx = SessionContext::new();
       let schema = Schema::new(vec![
           Field::new("id", DataType::Int16, false),
           Field::new("a", DataType::Int16, false),
       ]);
       let empty_table = Arc::new(EmptyTable::new(Arc::new(schema)));
       ctx.register_table("t1", empty_table)?;
       let sql = "with \
           v1 as (select * from t1), \
           v2 as (select * from v1, v1 v1a, v1 v1b where v1a.id = v1.id - 1 and 
v1b.id = v1.id + 1) \
           select * from v2";
       let actual = execute_to_batches(&ctx, sql).await;
       let expected = vec![
           "+----------+",
           "| Int64(1) |",
           "+----------+",
           "| 1        |",
           "+----------+",
       ];
       assert_batches_eq!(expected, &actual);
       Ok(())
   }
   ```
   
   Fails with:
   
   ```
   Schema contains duplicate qualified field name 'v1.id'
   ```
   
   **Expected behavior**
   Should not fail
   
   **Additional context**
   None
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to