generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 181
Support distinct count aggregation #116
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
…-project#100 Signed-off-by: chloe-zh <chloezh1102@gmail.com>
…-project#100 Signed-off-by: chloe-zh <chloezh1102@gmail.com> # Conflicts: # opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
penghuo
reviewed
Jun 10, 2021
...a/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java
Outdated
Show resolved
Hide resolved
penghuo
reviewed
Jun 10, 2021
...a/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java
Outdated
Show resolved
Hide resolved
penghuo
reviewed
Jun 10, 2021
core/src/main/java/org/opensearch/sql/expression/aggregation/MinAggregator.java
Outdated
Show resolved
Hide resolved
penghuo
reviewed
Jun 10, 2021
core/src/main/java/org/opensearch/sql/expression/aggregation/Aggregator.java
Outdated
Show resolved
Hide resolved
dai-chen
reviewed
Jun 10, 2021
integ-test/src/test/resources/correctness/queries/aggregation.txt
Outdated
Show resolved
Hide resolved
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
…-project#100 Signed-off-by: chloe-zh <chloezh1102@gmail.com> # Conflicts: # core/src/main/java/org/opensearch/sql/expression/DSL.java # core/src/main/java/org/opensearch/sql/expression/aggregation/NamedAggregator.java # core/src/test/java/org/opensearch/sql/analysis/ExpressionAnalyzerTest.java # docs/user/dql/aggregations.rst # integ-test/src/test/resources/correctness/queries/aggregation.txt # opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java # opensearch/src/test/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilderTest.java # sql/src/test/java/org/opensearch/sql/sql/parser/AstExpressionBuilderTest.java
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
Signed-off-by: chloe-zh <chloezh1102@gmail.com>
dai-chen
reviewed
Jun 16, 2021
core/src/main/java/org/opensearch/sql/expression/aggregation/CountAggregator.java
Outdated
Show resolved
Hide resolved
This was referenced Jul 23, 2021
Yury-Fridlyand
added a commit
that referenced
this pull request
Nov 1, 2022
…#116) Co-authored-by: MaxKsyunz <maxk@bitquilltech.com> Co-authored-by: forestmvey <forestv@bitquilltech.com> Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Chloe Zhang chloezh1102@gmail.com
Description
Grammar: enabled distinct count
SQL:
count(DISTINCT field)PPL:
distinct_count(field)/dc(field)instatscommandNote that distinct all
count(distinct *)is not supported, the grammar of MySQL to get the distinct count of all fields is to put all fields in the distinct count field: https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_count-distinct Not supported in this PR since the distinct count of multi-field is not implemented here. Will create another issue for this case.Core engine
Added distinct option in aggregators, and the distinct option is off by default, distinct count turns on this option.
Push down
Distinct count of single field in OpenSearch is achieved by building the cardinality aggregation, for example:
Explain of distinct count with filter:
SQL example:
PPL example: