kszucs opened a new issue #1411:
URL: https://github.com/apache/arrow-datafusion/issues/1411


   Quoted from @houqp:
   
   > .filter(df.column("bool_col")) should ignore the projection alias and only 
use the actual bool_col table column to evaluate the predicate. This is be 
behavior I see in postgres. For example SELECT id+1 as id2 FROM test where id2 
> 2 results in error: column "id2" does not exist.
   
   
   
   To reproduce:
   
   ```python
   import datafusion as df
   
   # bool_col is an integer here, convert it to be actually boolean
   bool_col = (df.column("bool_col") == df.literal(1)).alias("bool_col")
   result = table.select(bool_col).filter(df.column("bool_col"))
   result.collect()
   ```
   
   raises
   
   ```
   Exception: Error during planning: Ambiguous reference to field named 
'bool_col'
   ```
   
   _Originally posted by @kszucs in 
https://github.com/ibis-project/ibis/pull/2918#discussion_r749318005_


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to