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

bug: When I alias a dataframe and subsequently use SQL that references its columns, the aliasing process might not allow direct referencing of the original column names. #9152

Open
1 task done
stereoF opened this issue May 8, 2024 · 0 comments
Labels
bug Incorrect behavior inside of ibis clickhouse The ClickHouse backend

Comments

@stereoF
Copy link

stereoF commented May 8, 2024

What happened?

I have an Ibis dataframe named df with a column named account_id:

df.columns

['user_id', 'account_id', 'algo_user_addsteps_rate_30d', 'algo_user_pay_num', ..., 'province_shift_7d', 'city_shift_7d']

When I alias this dataframe as df and try to use it in a SQL query:

df1 = df.alias('df').sql('select *, halfMD5(account_id) as id_md5 from df')

I encounter the following error:

Code: 47. DB::Exception: Missing columns: 'account_id' while processing the query: 'WITH df AS (SELECT t6.user_id, t6.account_id, t6.algo_user_addsteps_rate_30d, t6.algo_user_pay_num, ......'t9.latest_totalrecharge_times_shift_7d' 't9.city_shift_7d'. (UNKNOWN_IDENTIFIER) (version 22.8.5.29)

Based on the error message, I must manually adjust the query as follows to execute it correctly:

df1 = df.alias('df').sql('select *, halfMD5(t6.account_id) as id_md5 from df')

What version of ibis are you using?

9.0.0

What backend(s) are you using, if any?

clickhouse

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stereoF stereoF added the bug Incorrect behavior inside of ibis label May 8, 2024
@gforsyth gforsyth added the clickhouse The ClickHouse backend label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis clickhouse The ClickHouse backend
Projects
Status: backlog
Development

No branches or pull requests

2 participants