Skip to content

group & select generates additional field "_expr_0"  #2079

Closed
@echou

Description

@echou
from `db.t`
derive d = create_time + 1
group d (
  aggregate [
    n1 = (a | sum),
  ]
)
sort d
select [ d1 = d, n1 ]

generates the result:

SELECT
  create_time + 1 AS d1,
  SUM(a) AS n1,
  create_time + 1 AS _expr_0
FROM
  db.t
GROUP BY
  create_time + 1
ORDER BY
  _expr_0

-- Generated by PRQL compiler version:0.6.0 (https://prql-lang.org)
  1. if select with group key, the key is added. (correct)
  2. if select without group key, _expr_0 is added. (correct. but not good)
  3. if select with group key alias, _expr_0 is added. (wrong)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugInvalid compiler output or panicpriority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions