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

feat(search): Supporting Aggregations for hasX fields #8241

Conversation

jjoyce0510
Copy link
Collaborator

@jjoyce0510 jjoyce0510 commented Jun 14, 2023

Summary

In this PR, we introduce support for adding default aggregations returned in search queries for the Has X field extensions that we support in our @searchable annotations.

This will enable returning aggs for cases where it's important to understand a boolean rollup of a particular field. For example, to understand whether Assertions are failing for an asset, or whether an asset has owners, domains, glossary terms.

Also, added a new file for testing AggregationQueryBuilder. More tests will be necessary here.

Example

These changes add a few new fields to the Searchable annotation, which enable aggregation by default on the hasX existence extension fields:

@Searchable = {
  "fieldName": "owners",
  "fieldType": "URN",
  "addToFilters": true,
  "addHasValuesToFilters": true,
  "hasValuesFieldName": "hasOwners",
  "queryByDefault": false,
  "filterNameOverride": "Owned By",
  "hasValuesFilterNameOverride": "Has Owners"
}
owner: Urn

Status

Ready for review

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Jun 14, 2023
@david-leifker
Copy link
Collaborator

The changes themselves look good, I'd just want to see more complete testing. I know you've tested the added code path, but if possible exercising older path through the new logic would be good.

…a-extensions' into jj--supporting-filtering-for-has-a-extensions
@anshbansal anshbansal merged commit d1ff902 into datahub-project:master Jun 16, 2023
35 of 36 checks passed
tusharm pushed a commit to tusharm/datahub that referenced this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants