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

Add auto aggregation suggest for t2v #514

Merged
merged 4 commits into from
Mar 20, 2025

Conversation

Hailong-am
Copy link
Collaborator

Description

Add auto aggregation suggest for t2v. It will depends on whether index pattern has time field or not, if it don't have time field, will simply use count as aggregation method, otherwise, trying to figure out the best interval for date histogram

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test.
  • New functionality has user manual doc added.
  • Commits are signed per the DCO using --signoff.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
ppl = `${ppl} | stats count()`;
} else {
// get min and max and calculate proper interval by range
const min = res.rawResponse.jsonData[0].min;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the generated ppl contains time range condition, then should we use that condition directly to narrow down the time range? Too many buckets maybe created if we use the max/min time in the index, which has poor performance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we didn't remove any filter in original ppl, what we do is get the range for existing query result and append a date histogram aggregation

Signed-off-by: Hailong Cui <[email protected]>
@Hailong-am Hailong-am merged commit bceb8ab into opensearch-project:main Mar 20, 2025
9 checks passed
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.

4 participants