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

more docs #31

Merged
merged 1 commit into from
Apr 17, 2023
Merged

more docs #31

merged 1 commit into from
Apr 17, 2023

Conversation

ruslandoga
Copy link
Contributor

No description provided.

@ruslandoga ruslandoga force-pushed the more-docs branch 2 times, most recently from a288426 to 96f21a3 Compare April 17, 2023 10:37
README.md Outdated
LIMIT 2
)
ORDER BY h0."count" DESC
LIMIT 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe add an example on how to reproduce this same postgresql behaviour in clickhouse?

Maybe with an additional subquery we could get:

subq = union_all(hits, ^visits)
same_behaviour_as_postgresql = from(f in subquery(subq), limit: 2, order_by: [desc: :count]) 
select f."counter_id" from (
  SELECT h0."counter_id"
  FROM "hits" AS h0
  UNION ALL (
    SELECT v0."counter_id"
    FROM "visits" AS v0
    ORDER BY v0."count" DESC
    LIMIT 2
  )
) f
ORDER BY f."count" DESC
LIMIT 2

( I did not test my code but believe that should do it 🙈 )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm thinking about raising if there are both query.combinations and query.offset or query.limit set. And the error messages would point at using subquery

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#38

Copy link
Contributor

@Zarathustra2 Zarathustra2 Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! :) , I think this will help the end user

@ruslandoga ruslandoga marked this pull request as ready for review April 17, 2023 12:04
@ruslandoga ruslandoga merged commit 7139232 into master Apr 17, 2023
@ruslandoga ruslandoga deleted the more-docs branch April 17, 2023 12:05
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 this pull request may close these issues.

2 participants