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

Supporting aggregation w/o even if group by missing #123

Open
kotharironak opened this issue Aug 26, 2022 · 0 comments
Open

Supporting aggregation w/o even if group by missing #123

kotharironak opened this issue Aug 26, 2022 · 0 comments
Assignees

Comments

@kotharironak
Copy link
Contributor

Issue

As part of this - #82, we have provided support for new generic query API support for postgres.

Now, we have two different implemenation of this API

  • one for MongoDb
  • one for Postgres

As the query API is generic, there are some differences in how the underlying store handles them.
E.g In the below query : we are applying aggregation w/o group by clasue

org.hypertrace.core.documentstore.query.Query query =
        org.hypertrace.core.documentstore.query.Query.builder()
            .addSelection(
                AggregateExpression.of(DISTINCT_COUNT, IdentifierExpression.of("quantity")),
                "qty_count")
            .addSelection(IdentifierExpression.of("item"))
            .addSelection(IdentifierExpression.of("price"))
            .setFilter(
                LogicalExpression.builder()
                    .operator(AND)
                    .operand(
                        RelationalExpression.of(
                            IdentifierExpression.of("price"), LTE, ConstantExpression.of(10)))
                    .operand(
                        RelationalExpression.of(
                            IdentifierExpression.of("item"),
                            IN,
                            ConstantExpression.ofStrings(
                                List.of("Mirror", "Comb", "Shampoo", "Bottle"))))
                    .build())
            .build();

The above is supported in mongo impl, but not in postgres. As part of this ticket, can we add support for the same in postgres?

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

No branches or pull requests

1 participant