Skip to content

join inside a group clause causes panic #5280

Open
@albx79

Description

@albx79

What happened?

I wrote a query that should select all companies with more than one addreses, and list all addresses except the most recent one.

However, I get a compiler panic on the playground.

PRQL input

from c = companies
join ca = companies_addresses(c.tax_code == ca.company)
group c.tax_code (
  join a = addresses(a.id == ca.address)
  sort {-ca.created_at}
  take 2..
)
sort tax_code

SQL output

A compiler bug was encountered. Please copy/paste the PRQL query into a new report at:
   https://github.com/PRQL/prql/issues/new?template=bug_report.yaml

Expected SQL output

(I have no idea how to write this query in SQL)

MVCE confirmation

  • Minimal example
  • New issue

Anything else?

It may be related to #3870

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugInvalid compiler output or panic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions