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

append is buggy with a bit of logic in tables #4947

Open
2 tasks done
PrettyWood opened this issue Oct 10, 2024 · 1 comment
Open
2 tasks done

append is buggy with a bit of logic in tables #4947

PrettyWood opened this issue Oct 10, 2024 · 1 comment
Labels
bug Invalid compiler output or panic

Comments

@PrettyWood
Copy link
Collaborator

What happened?

Still working on a query builder to convert transformation steps into SQL via PRQL
We have an issue with append that doesn't seem to work well with basic tables
I'm more than happy to help on debugging this

PRQL input

from `albums`
select { `album_id`, `title` }
sort {+`album_id`}
take 2
append (
  from `albums`
  select { `album_id`, `title` }
  sort {-`album_id`}
  take 2
)

SQL output

fails

Expected SQL output

WITH table_0 AS (
  SELECT
    album_id,
    title
  FROM
    albums
  ORDER BY
    album_id DESC
  LIMIT
    2
)
SELECT
  *
FROM
  (
    SELECT
      album_id,
      title
    FROM
      albums
    ORDER BY
      album_id
    LIMIT
      2
  ) AS table_1
UNION
ALL
SELECT
  *
FROM
  table_0

MVCE confirmation

  • Minimal example
  • New issue

Anything else?

No response

@PrettyWood PrettyWood added the bug Invalid compiler output or panic label Oct 10, 2024
@PrettyWood PrettyWood changed the title append is buggy with subtables append is buggy with a bit of logic in tables Oct 10, 2024
@PrettyWood
Copy link
Collaborator Author

It may be the same bug as #4063. I'll start digging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Invalid compiler output or panic
Projects
None yet
Development

No branches or pull requests

1 participant