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: group checker incorrect #17400

Open
sundy-li opened this issue Feb 3, 2025 · 0 comments · May be fixed by #17402
Open

bug: group checker incorrect #17400

sundy-li opened this issue Feb 3, 2025 · 0 comments · May be fixed by #17402
Assignees

Comments

@sundy-li
Copy link
Member

sundy-li commented Feb 3, 2025

Summary


CREATE OR REPLACE  TABLE u (
  id VARCHAR NULL
);



CREATE OR REPLACE TABLE c (
  id VARCHAR NULL,
  encounter_id VARCHAR NULL,
  person_id VARCHAR NULL,
  client_code VARCHAR NULL,
  what_fuck BOOLEAN NOT NULL,  -- change to `what_fuck BOOLEAN NULL` or remove this column will be fine
  payload VARIANT NULL
);


select
    ids.id,
    array_filter(array_agg(case when px.payload is not null and px.payload:px_code_set <> 'CPT' then px.payload:px_key else null end),x-> x is not null) as px_payload
  from u ids
    left join c  px on px.encounter_id = ids.id
  group by ids.id;
 

error: APIError: QueryFailed: [1065]error:
  --> SQL:3:139
  |
1 | select
2 |     ids.id,
3 |     array_filter(array_agg(case when px.payload is not null and px.payload:px_code_set <> 'CPT' then px.payload:px_key else null end),x-> x is not null) as px_payload
  |                                                                                                                                           ^ column "x" must appear in the GROUP BY clause or be used in an aggregate function

@b41sh b41sh linked a pull request Feb 3, 2025 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants