Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous reference to aliased column #1411

Closed
kszucs opened this issue Dec 7, 2021 · 0 comments · Fixed by #1925
Closed

Ambiguous reference to aliased column #1411

kszucs opened this issue Dec 7, 2021 · 0 comments · Fixed by #1925
Labels
bug Something isn't working

Comments

@kszucs
Copy link
Member

kszucs commented Dec 7, 2021

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:

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 ibis-project/ibis#2918 (comment)

@kszucs kszucs added the bug Something isn't working label Dec 7, 2021
@alamb alamb added python and removed python labels Dec 15, 2021
jonmmease added a commit to vega/vegafusion that referenced this issue Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants