clickhouse-scala-client icon indicating copy to clipboard operation
clickhouse-scala-client copied to clipboard

Re-aliasing an aliased column doesnt work

Open erdebee opened this issue 8 years ago • 1 comments

When I want to do the following:

SELECT from_pv as from_start FROM (
  SELECT from as from_pv FROM report.pages
)

I would probably do it like this:

val from_pv = Pages.from as "from_pv"

select(from_pv as "from_start").from(
  select(from_pv).from(report.pages)
)

but that is currently causing below query:

SELECT from as  from_pv as from_start FROM (
  SELECT from as from_pv FROM report.pages
)

erdebee avatar Mar 07 '18 14:03 erdebee

We should keep track of the aliased columns used in sub selects and then use just the alias in the top level select

ecyshor avatar Mar 07 '18 15:03 ecyshor