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(sql): base SQL backend discards column names #3754

Closed
mikegraham opened this issue Apr 11, 2022 · 0 comments · Fixed by #3755
Closed

bug(sql): base SQL backend discards column names #3754

mikegraham opened this issue Apr 11, 2022 · 0 comments · Fixed by #3755
Labels
sql Backends that generate SQL
Milestone

Comments

@mikegraham
Copy link

For a ColumnExpr that isn't a TableColumn, the base SQL backend unconditionally uses the name 'tmp' for the resulting query, rather than retaining the name

>>> import ibis.backends.base.sql
>>> simple_table = ibis.table(
...         [
...             ('int_col', 'int32'),
...         ],
...         'simple_table',
...     )
>>> expr = (simple_table.int_col + 3).name('foo')
>>> ibis.backends.base.sql.Compiler().to_sql(expr)
'SELECT `int_col` + 3 AS `tmp`\nFROM simple_table'

It seems like this should result in 'SELECT int_col+ 3 ASfoo\nFROM simple_table'

mikegraham pushed a commit to mikegraham/ibis that referenced this issue Apr 11, 2022
@cpcloud cpcloud changed the title Base SQL backend discards column names bug(sql): base SQL backend discards column names Apr 18, 2022
@cpcloud cpcloud added the sql Backends that generate SQL label Apr 18, 2022
@cpcloud cpcloud added this to the 3.x milestone Apr 18, 2022
cpcloud pushed a commit to cpcloud/ibis that referenced this issue Apr 19, 2022
cpcloud pushed a commit to mikegraham/ibis that referenced this issue Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql Backends that generate SQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants