ntjohnson1 opened a new issue, #19548:
URL: https://github.com/apache/datafusion/issues/19548

   ### Describe the bug
   
   If we try to drop a column using drop_columns but with a qualified name 
`table.col` then it doesn't match and silently skips the attempt to drop the 
column. See repro below where I'd expect the plans to match.
   
   ### To Reproduce
   
   ```rust
   let mut t = test_table().await?;
   t = t.select_columns(&["c1", "c2", "c11"])?;
   let mut t2 = test_table_with_name("another_table").await?;
   t2 = t2.select_columns(&["c1", "c2", "c11"])?;
   let mut t3 = t.join_on(
      t2,
      JoinType::Inner,
      [col("aggregate_test_100.c1").eq(col("another_table.c1"))],
   )?;
   t3 = t3.drop_columns(&["another_table.c2", "another_table.c11"])?;
   
   let plan = t3.logical_plan().clone();
   
   let sql = "SELECT aggregate_test_100.c1, aggregate_test_100.c2, 
aggregate_test_100.c11, another_table.c1  FROM (SELECT c1, c2, c11 FROM 
aggregate_test_100) INNER JOIN (SELECT c1, c2, c11 FROM another_table) ON 
aggregate_test_100.c1 = another_table.c1";
   let ctx = SessionContext::new();
   register_aggregate_csv(&ctx, "aggregate_test_100").await?;
   register_aggregate_csv(&ctx, "another_table").await?;
   let sql_plan = ctx.sql(sql).await?.into_unoptimized_plan();
   ```
   
   ### Expected behavior
   
   The sql plans match. Or (less nice) the documentation mentions this 
limitation and there is an error.
   
   ### Additional context
   
   _No response_


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to